edited death function