added 'gettemplate' function