updated search query contruction in controller