Implemented previous search functionality