bugfix with switch