adapt to new API