adding back socket logic