Change lumi_template function to properly check for existing instance.