         }
         switch self.selectplan.indexOfSelectedItem {
         case 1:
+            self.config!.snaplast = 1
             _ = PlanSnapshots(plan: 1, snapdayoffweek: self.config?.snapdayoffweek ?? "Sunday")
         case 2:
+            self.config!.snaplast = 2
             _ = PlanSnapshots(plan: 2, snapdayoffweek: self.config?.snapdayoffweek ?? "Sunday")
         default:
             return

        guard configurations.count > 0 else { return }
        if let index = self.index {
            configurations[index].snapdayoffweek = self.config!.snapdayoffweek
            switch self.selectplan.indexOfSelectedItem {
            case 1:
                configurations[index].snaplast = 1
            case 2:
                configurations[index].snaplast = 2
            default:
                configurations[index].snaplast = 0
            }
            // Update configuration in memory before saving
            self.configurations!.updateConfigurations(configurations[index], index: index)
        }

        self.stringdeletesnapshotsdaysnum.delegate = self
        self.selectplan.delegate = self
        self.selectdayofweek.delegate = self
        self.savebutton.isEnabled = false
        ViewControllerReference.shared.setvcref(viewcontroller: .vcsnapshot, nsviewcontroller: self)
    }

