 extension ViewControllerSchedule: NSTableViewDelegate, Attributedestring {
 
    func tableView(_ tableView: NSTableView, objectValueFor tableColumn: NSTableColumn?, row: Int) -> Any? {
-    if tableView == self.scheduletable {
-        guard row < self.configurations!.getConfigurationsDataSourceSynchronize()!.count else { return nil }
-            let object: NSDictionary = self.configurations!.getConfigurationsDataSourceSynchronize()![row]
-            let hiddenID: Int = object.value(forKey: "hiddenID") as? Int ?? -1
-            switch tableColumn!.identifier.rawValue {
-            case "scheduleID" :
-                if self.schedulessorted != nil {
-                    let schedule: String? = self.schedulessorted!.sortandcountscheduledonetask(hiddenID, profilename: nil, number: false)
-                    if schedule?.isEmpty == false {
-                        switch schedule {
-                        case "once":
-                            return NSLocalizedString("once", comment: "main")
-                        case "daily":
-                            return NSLocalizedString("daily", comment: "main")
-                        case "weekly":
-                            return NSLocalizedString("weekly", comment: "main")
-                        case "manuel":
-                            return NSLocalizedString("manuel", comment: "main")
-                        default:
+        if tableView == self.scheduletable {
+            if row < self.configurations!.getConfigurationsDataSourceSynchronize()?.count ?? 0 {
+                let object: NSDictionary = self.configurations!.getConfigurationsDataSourceSynchronize()![row]
+                let hiddenID: Int = object.value(forKey: "hiddenID") as? Int ?? -1
+                switch tableColumn!.identifier.rawValue {
+                case "scheduleID":
+                    if self.schedulessorted != nil {
+                        let schedule: String? = self.schedulessorted!.sortandcountscheduledonetask(hiddenID, profilename: nil, number: false)
+                        if schedule?.isEmpty == false {
+                            switch schedule {
+                            case "once":
+                                return NSLocalizedString("once", comment: "main")
+                            case "daily":
+                                return NSLocalizedString("daily", comment: "main")
+                            case "weekly":
+                                return NSLocalizedString("weekly", comment: "main")
+                            case "manuel":
+                                return NSLocalizedString("manuel", comment: "main")
+                            default:
+                                return ""
+                            }
+                        } else {
                             return ""
                         }
+                    }
+                case "offsiteServerCellID":
+                    if (object[tableColumn!.identifier] as? String)!.isEmpty {
+                        if self.index() ?? -1 == row && self.index == nil {
+                            return self.attributedstring(str: "localhost", color: NSColor.red, align: .left)
+                        } else {
+                            return "localhost"
+                        }
                     } else {
-                        return ""
-                    }
-                }
-            case "offsiteServerCellID":
-                if (object[tableColumn!.identifier] as? String)!.isEmpty {
-                    if self.index() ?? -1 == row && self.index == nil {
-                        return self.attributedstring(str: "localhost", color: NSColor.red, align: .left)
-                    } else {
-                        return "localhost"
-                    }
-                } else {
+                        if self.index() ?? -1 == row && self.index == nil {
+                            let text = object[tableColumn!.identifier] as? String
+                            return self.attributedstring(str: text!, color: NSColor.red, align: .left)
+                        } else {
+                            return object[tableColumn!.identifier] as? String
+                        }
+                    }
+                case "inCellID":
+                    if self.schedulessorted != nil {
+                        let taskintime: String? = self.schedulessorted!.sortandcountscheduledonetask(hiddenID, profilename: nil, number: true)
+                        return taskintime ?? ""
+                    }
+                default:
                     if self.index() ?? -1 == row && self.index == nil {
                         let text = object[tableColumn!.identifier] as? String
                         return self.attributedstring(str: text!, color: NSColor.red, align: .left)

                        return object[tableColumn!.identifier] as? String
                    }
                }
            case "inCellID":
                if self.schedulessorted != nil {
                    let taskintime: String? = self.schedulessorted!.sortandcountscheduledonetask(hiddenID, profilename: nil, number: true)
                    return taskintime ?? ""
                }
            default:
                if self.index() ?? -1 == row && self.index == nil {
                    let text = object[tableColumn!.identifier] as? String
                    return self.attributedstring(str: text!, color: NSColor.red, align: .left)
                } else {
                    return object[tableColumn!.identifier] as? String
                }
            }
        return nil
    } else {
        var active: Bool = false
        let dateformatter = Dateandtime().setDateformat()
        guard self.scheduledetails != nil else { return nil }
        if row < self.scheduledetails!.count {
            let object: NSMutableDictionary = self.scheduledetails![row]
            if  object.value(forKey: "schedule") as? String == "once" ||
                object.value(forKey: "schedule") as? String == "daily" ||

                    active = false
                }
            }
            switch tableColumn!.identifier.rawValue {
            case "stopCellID", "deleteCellID":
                return object[tableColumn!.identifier] as? Int
            case "schedule":
                switch object[tableColumn!.identifier] as? String {
                case "once":
                    return NSLocalizedString("once", comment: "main")
