changed save/restore logic of settings