fix issue with local types in template