edited addTask

catches exception