updated index.js to reflect new renderWidget function