Duplicate event call onclick Delphi

When you run the onclick event (from the btn_ImportarNFe button), the program calls the same onclick event again from the method call. Nfe.EnviarEvento (StrToInt (IDLote)); second code snippet (see the complete list below). When the same onclick event is run in debug mode, this second call does not take place.

ImportNFe procedure code snippet:

                procedure TfrmLibraryExpenses.btn_ImportNFeClick (Sender: TObject);
var
dlgImportarNFe: TFrm_BuscarChave;
Key, CNPJ, idLote: string;
i: integer;
XMLtsl: TStringList;
XMLStream: TStringStream;
to start
dlgImportarNFe: = TFrm_BuscarChave.Create (nil);
XMLtsl: = TStringList.Create;
XMLStream: = TStringStream.Create;

dlgImportarNFe.ShowModal;

if dlgImportarNFe.ModalResult = mrCancel then
to start
Exit
end
d & # 39; other
to start
if dlgImportarNFe.chk_BuscarXML.Checked = False then
to start
Key: = dlgImportarNFe.edt_Chave.Text;
CNPJ: = dm.CompanyControlada.CGC;
idLote: = 1 & # 39;

dlgImportarNFe.free;

dm_NFe.EventConfirmation (Key, idLote, CNPJ);
dm_NFe.DistributionDFePorChaveNFe (31, CNPJ, key);
op.FileName: = dm_NFe.nfe.Configurations.Archives.DownloadNFe.PathDownload + dm_NFe.nfe.WebServices.DistributionDFe.ListArqs[0];
end
...

Code snippet with the SendEvent method:

Tdm_NFe.EventConfirmation procedure (Key, idLote, CNPJ: string);
var
lMsg: chain;
ReturnWS: string;
to start
Key: = Trim (OnlyNumber (Key));
idLote: = Trim (OnlyNumber (idLote));
CNPJ: = Trim (OnlyNumber (CNPJ));

nfe.Configuracoes.WebServices.Ambiente: = dm_NFe.tipoAmbiente;
nfe.Configurations.Certificates.NumberSeries: = dm_logon.dat_CompanyCTRLNUMSERIE_NFE.AsString;
nfe.Configuracoes.WebServices.UF: = & # 39; MG & # 39 ;;
DataModuleCreate (nil);

NFE.EventoNFe.Evento.Clear;
with Nfe.EventoNFe.Evento.Add do
to start
InfEvento.cOrgao: = 91;
infEvento.chNFe: = key;
infEvento.CNPJ: = CNPJ;
infEvento.dhEvent: = now;
infEvento.tpEvento: = teManifDestConfirmation;
end

Nfe.EnviarEvento (StrToInt (IDLote));
...

Someone knows what could happen?