Get the document correctly