Issue #307 Fixed relationship between entities