fix schedule generation