added programmatical way to load template at end of body element