relation loop bug fix