fixed bug in csv output