Added check if query is blank, (empty for just whitespace)