fixed rate.js a bit