use length after document modification