fix index.js bug