moved socket logic to outside the widget