bugfix for index.js