fixed problem with templates