fix in switch script generation