adapted to library changes