Fixed bug with unscheduling