add replace command and add battles to history