fix update relation for distince