Fixed a switch problem