fixed bug in switch_num
S