update code for switch,modal,pymatcher