bugfix switch that did not return the proper current value