updated widget.js file