added logging on battle.js