adapted to new version