Fix data loss on device configuration change