passing latest row value to the download function