creates toggling action for search bar