Adapt to api change