fixes behavior when the query contains blank (space) characters that usually bring an unwanted result