add some code for document