fixed file sending from templates