joining logic changed