Fixed a bug in index.js