added a control to make sure that the theme exists before fetching the templates
now templates can be genearated also when they have no slots