Fixing problem with search functionality