fix bug in csv download

newline characters were not being properly encoded due to a silly bug