Fixed exception when no tasks