Update index.js

small best practice change