fix the search and use thread.