Adapt to newer API