fixed an incorrect assertion failure when cancelling a handle that might already have finished