fix bugs of thread pool