fixed bug in csv dumping when using socket