Solved the issue with saving values to csv files.
Deleted CsvWriter class.