Handle cancellation.