added missing piece to save_file function