     }
 
     private func updateProgressbar(progress: NSProgressIndicator) {
-        let value = Double(self.batchTask?.incount() ?? 0)
+        let value = Double(self.executebatch?.incount() ?? 0)
         progress.doubleValue = value
     }
 

extension ViewControllerBatch: GetNewBatchTask {

    func getbatchtaskObject() -> ExecuteBatch? {
        return self.batchTask
    }
}

extension ViewControllerBatch: ReportonandhaltonError {
    func reportandhaltonerror() {
        self.abort()
        self.batchTask?.closeOperation()
        self.batchTask = nil
        self.estimatingbatchlabel.stringValue = "Error"
        self.estimatingbatchlabel.textColor = setcolor(nsviewcontroller: self, color: .red)
    }

        ViewControllerReference.shared.setvcref(viewcontroller: .vcbatch, nsviewcontroller: self)
        self.mainTableView.delegate = self
        self.mainTableView.dataSource = self
        self.executebatch = ExecuteBatch()
        self.batchisrunning = false
        self.executeButton.isEnabled = true
        self.estimatingbatch.usesThreadedAnimation = true
