fix batch bugs