refactor dying event