Added support for multiple templates in addCustom()