Update record_download function