fix bug in index.js