update main document