fixes for bug(null reference) at end of battle