Corrected the duplicates caused by merging