Not sure if this is the best way to hold onto this, but it needs to be in place right away for the template to reference it.  Seems to work pretty well.