Fix the query