updated to new API

updated to new API