fixed bugs in scheduler.rb