Fixed the search method