fix bug with no extension files (template substitution)