makes functions for refactoring resetSerach function