Adapt to upstream api change