Checking for cancellation.