Fixed bug in index.js