Fixed the query