private function batchesFinished($batchesResult)
    {
        $allfinished = true;
        foreach ($batchesResult as $key => $batch) {
            if ($batch['Status'] != 'Completed') {
                $allfinished = false;
            }
        }
        return $allfinished;
    }