fix csv downloading #597