Improved pagination system for datatables