     private func sortAndExpandScheduleTasks() {
         for i in 0 ..< (self.schedulesNSDictionary?.count ?? 0) {
             let dict = self.schedulesNSDictionary![i]
-            let dateStop: Date = (dict.value(forKey: "dateStop") as? String)!.en_us_date_from_string()
-            let dateStart: Date = (dict.value(forKey: "dateStart") as? String)!.en_us_date_from_string()
-            let schedule: String = (dict.value(forKey: "schedule") as? String)!
+            let dateStop: Date = (dict.value(forKey: "dateStop") as? String)?.en_us_date_from_string() ?? Date()
+            let dateStart: Date = (dict.value(forKey: "dateStart") as? String)?.en_us_date_from_string() ?? Date()
+            let schedule: String = (dict.value(forKey: "schedule") as? String) ?? Scheduletype.once.rawValue
             let seconds: Double = dateStop.timeIntervalSinceNow
             // Get all jobs which are not executed
             if seconds > 0 {

                        "timetostart": time,
                        "profilename": profilename,
                    ]
                    self.expandedData?.append(dict)
                case Scheduletype.daily.rawValue:
                    self.daily(dateStart: dateStart, schedule: schedule, dict: dict)
                case Scheduletype.weekly.rawValue:

                    "timetostart": time,
                    "profilename": profilename,
                ]
                self.expandedData?.append(dictschedule)
            }
        }
    }
