fix thread pool bug