refactored and broke the search bar