adapted to changed api