adapted to recent changes