improved logic in task scheduling