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