fixed the tab reordering bug, note that tabs are not swapped but are removed and inserted instead