addressed seg fault in threadpool