added functionality to search/cancel buttons