corrects issue #42 for index.js