fix a logical error in a feature flag scenario