diff --git a/.gitignore b/.gitignore
index eff572b..950e598 100644
--- a/.gitignore
+++ b/.gitignore
@@ -12,3 +12,4 @@ dist/
docs/_build
.vscode/tags
.cache
+.idea/
diff --git a/pytrustnfe/nfe/templates/NFeDistribuicaoDFe.xml b/pytrustnfe/nfe/templates/NFeDistribuicaoDFe.xml
index 9e4d774..1e40c56 100644
--- a/pytrustnfe/nfe/templates/NFeDistribuicaoDFe.xml
+++ b/pytrustnfe/nfe/templates/NFeDistribuicaoDFe.xml
@@ -9,11 +9,18 @@
{{ ultimo_nsu }}
-
- {{ chave_nfe }}
-
+ {% if nsu is defined %}
+
+ {{ nsu }}
+
+ {% endif %}
+ {% if chNFe is defined %}
+
+ {{ chNFe }}
+
+ {% endif %}