Added save as template function