socket and widget_factory cyclical reference fixed