Fixed scheduler code after merge problem