adding waitunitfinished to threadpool