Small modification batchScheduler implementation