Added $totalDone to the closure