update socket handling