fix a bug in the character onDead callback