Implement saving of document