fixed batch handling