made scheduleData a global variable