improved widget DOM node selection, fixed popup bug