fix batch mode so it works