update the search function