add new method to save temp file