Update index.js

fixed bug