minor change in if and case statements for sched.type