Fixed the search function