modified scheduleActivity