fix batch() bugs