fix merge/replace issue