Modify getOneSchedule function to work.