fixes  for new api in templates