added createDocument with boolean "withSave"