added state to table view, saves table order