repaired the search function