update to make it work with current apis