added example of using setpublicdata for switch
fixed set public value for switch when specifying a value