index.js bug fixed