updated search functionality