adapted to changes in api