fix batched mode