fix a bug in the switch driver, thanks to Thomas Langer for reporting