corrected the label-switch functions