fix blocking code upon thread instantiation