fix index.js issues