fixed minor bug in js index.js