adds EventEmitter into widget.js