Fix the bug when player dies.