fixes an unwanted behavior when the query contains blank (space) characters