max_csv bug fix