some changes to scheduler