Added an error message when a query is specified