more improvements to scheduler