added handler for templates