added some template callback functions,(etc. templatenew, templateopen,....)