update switch detection