thread pool is not working as expected