Changed the coe to handle respawn