fix error when there are no tasks