fix problem with string passing to the generatetemplate function