added a HasTasks check to see if there are scheduled tasks waiting