update merge code