fixing the query syntax.