save config only on clean shutdown