fixed the query