Update main.xml

Fix for appTemplates and some popping issues.