added death condition to end the battle