handling disconnected socket