fix the directory layout and make a copy of the document list