fixed deleted switch detection