fixed index.js for browsers