fix waiting threads check in pool