fixed wrong socket object in socket handling