added thread pool support