fix the bug in BatchProcessor