Added isDead check