state of devices is saved upon switch