Fixed a query error