fix the query.