bug fix after document as root change