Fix conection error logic path