fix tmpl permission file mess