fix null pointer crash on death