finished search functionality