Update main.js for switch