Fix entity relationship