fix "MailCore bug" when connection is lost