Fixes onStateChange selection for persistence