socket logic change