added setScheduleFunction