correct code to enable replacable _dospawn function