corrected error in merge that resulted in mixing up rows