Implemented searching in threads