Adapt to new API
Adapt to new API