Re-wrote sleep portion

Fixed issue with it not posting following the scheduled sleep time.