fixing entities relationships