Debugged the search