fixed template eval bug