added search component, fixed search query bug in controller