integrated the csv download function