Updated switchOn() with a check to make sure that the module is connected before attempting to switch on