version with thread pool