fix bug with table when resorting; add the switcher;