Fixed a memory leak when datatables are refreshed