Makes the battle window close properly