fix bug by always using schedule_generator before saving + function renaming