emit disconnect after connect error only if connection is established