fix bug from get switch function