updating logic for plain doc page