Fix issue when we get connection refused