Changed the controller and finally got the search bar working