Offloaded selection buttons logic to function and called it at intialization as well as each search request