Fixing "Not an entity"