added functionality to download-as-csv