added support for switch