     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 {

                    let hiddenID = (dict.value(forKey: "hiddenID") as? Int)!
                    let profilename = dict.value(forKey: "profilename") ?? NSLocalizedString("Default profile", comment: "default profile")
                    let time = seconds
                    let dict: NSDictionary = [
                        "start": dateStart,
                        "hiddenID": hiddenID,
                        "dateStart": dateStart,

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