adapted to the changes recently in the Entity class