change addTask to safeCall