closing socket connection