some minor changes in index.js