Save documents correctly