change reduce in groupingfinishedmethod to fold