Fixed bug in adding widgetVar attribute