check if query is empty