fixed template bug with emails