fixed mistake in test connection error handling