added save and restore the template file