Modify the task instead of overwriting it when closing it.