fixed document merging