handle socket.error connection refused