Make sure the query is not blank