Update index.js

merging patches