fix the query syntax