handled the connection error case