Update index.js

Bug fix