fixed bug in index.js