fixed a at-least-one-year-old bug which caused crashed in the scheduler