fixed small bug with spaces in query