bug printing code in scheduler