adapted to new AutoDoc