type based cancellation