fix up merge fn