function is invoked by index.js