fixed a bug in add gswitch