Minor fix to addTask