perfect the document