Restore state when adding or removing electrodes