Added conditions for entity relations