fix attachment merge bug