diff --git a/libs/cbi/luasrc/view/cbi/ucisection.htm b/libs/cbi/luasrc/view/cbi/ucisection.htm
index c245940d4b..e129c9526e 100644
--- a/libs/cbi/luasrc/view/cbi/ucisection.htm
+++ b/libs/cbi/luasrc/view/cbi/ucisection.htm
@@ -15,14 +15,15 @@ $Id$
<% self:render_children(section, scope or {}) %>
-<% if #self.optionals[section] > 0 or self.dynamic then %>
- <% if self.tag_deperror[section] then -%>
-
<%:cbi_deperror%>
- <% elseif self.tag_invalid[section] then -%>
- <%:cbi_invalid_section%>
- <%- elseif self.tag_error[section] then -%>
- <%=self.tag_error[section]%>
- <%- end %>
+<% if self.tag_deperror[section] then -%>
+ <%:cbi_deperror%>
+<% elseif self.tag_invalid[section] then -%>
+ <%:cbi_invalid_section%>
+<%- elseif self.tag_error[section] then -%>
+ <%=self.tag_error[section]%>
+<%- end %>
+
+<% if self.optionals[section] and #self.optionals[section] > 0 or self.dynamic then %>
<% if self.dynamic then %>