Update index.js

for resolving #510