finish the search function
finish the search function