fix crash in spawn_sh