Fix switchOn & switchOff, modify connect method