updated controller, enabled value state set in search on the  refreshing of the page