added py2 support for csv export