adapted to api changes