Prevent ConcurrentModificationException related to encoding an internal field within HostState