correct code to enable replaceable _dospawn function