fixes to index.js