added missing inDocument function