Fixed bug with queries with spaces