fix a small bug in index.js