small changes to widget.js