Save current file before closing