modify sort.js to remove global veriable