bugfix for switch statement