bug fix of scheduler