fix bug with table reorder