use encodeURIComponent
rename inspawn to inSpawn