Fixed the SearchController to stop at end