write new document