Fix issue preventing csv export from working