fix parsing of switch states