Typo in the function, miss a 'RETURN QUERY' in the second part of the function
Typo in the function, miss a 'RETURN QUERY' in the second part of the function