Updated to new API
finish update to new API