fixed cannot read property from doc exception