fix invalid array.to_s when old ruby version