 
     // Close and dismiss view
     @IBAction func close(_ sender: NSButton) {
-        if self.completed == false {
-            self.abort()
-        }
+        if self.estimation != nil && self.outputprocess != nil { self.abort() }
+        if self.completed == false { self.abort()}
         self.dismissview(viewcontroller: self, vcontroller: .vctabmain)
     }
 


    override func viewDidAppear() {
        super.viewDidAppear()
        self.estimation = true
        self.completed = false
        self.restorebutton.isEnabled = false

        if answer {
            if let index = self.index(viewcontroller: .vctabmain) {
                self.restorebutton.isEnabled = false
                self.estimation = true
                self.initiateProgressbar()
                self.outputprocess = OutputProcess()
                self.sendprocess?.sendoutputprocessreference(outputprocess: self.outputprocess)
