fix export csv bug

undefined method `join' for nil:NilClass