fixed the search functionality