move flattenTermsTwo before AddStreamCells