fix protect spawnwait