preventing search on empty string