trying to fix threadpool segfault errors