to resolve the thread problem