fix batch bug