fix batch section function