fix merge_rec bug