It's not obvious because of the limited scope, but what I'm doing here is moving bool isSet from the child to the parent, and making it protected.