fix relations bug