Added connection refused error handling