getWidgetName condition fixed