Update type of the document