Removal of duplicate saveAs caused by merge