fixed first critical bugs of thread pool