Fixed to avoid crashing when there are no schedules.