fix up Thread pool bugs