added sample for config change
save the state on config changes