proper spawn function