fix entity relations