Added entityreference patch