add thread pool support