corrected bug in index.js