update connectivitySwitch.js