fix merging bugs