exiting on closed socket