Update for the new API which requires CancellationTokens