adapted to change of API