fixed the duplication of tasks bug