Reimplimented Dave's fix for datatables