added appenddocument example