add threadpool support