fix bugs; changed thread pool gem