update switch.js