fixed bug with infinite loop
added > in battle loop