Fixing addTask bug