protection for running onSearchClear before search