improve performance by modify ModifyTable function