Update index.js

same change as the PR
Added ability to have reference number