added support for switches