Spawn code added