rewrite get_switch method