memory freed when entity is removed