Cancel tasks when done.