fixed invalid document access