add

invariant for document update