debugging encodig issue in writingaggregated grid doc