fix a bug with generating the encounter template