update spawn logic.