         self.selectedstart.isHidden = true
         self.startdate.dateValue = Date()
         self.starttime.dateValue = Date()
-        if self.schedulessorted == nil {
-            self.schedulessorted = ScheduleSortedAndExpand()
-        }
-        globalMainQueue.async(execute: { () -> Void in
-            self.scheduletable.reloadData()
-            self.scheduletabledetails.reloadData()
-        })
+        self.reloadtabledata()
         self.delayWithSeconds(0.5) {
             self.enablemenuappbutton()
         }


    func dismiss_view(viewcontroller: NSViewController) {
        self.dismiss(viewcontroller)
        globalMainQueue.async(execute: { () -> Void in
            self.scheduletable.reloadData()
        })
    }
}


                self.index = index
                let hiddendID = self.configurations?.gethiddenID(index: self.index ?? -1)
                self.scheduledetails = self.schedules?.readscheduleonetask(hiddenID: hiddendID)
            } else {
                self.index = nil
                self.scheduledetails = nil
            }
            globalMainQueue.async(execute: { () -> Void in
                self.scheduletabledetails.reloadData()
            })
        }
    }

