diff --git a/alib2algo/src/regexp/simplify/RegExpOptimizeUnboundedPart.hpp b/alib2algo/src/regexp/simplify/RegExpOptimizeUnboundedPart.hpp
index 00fb3cef1a6e0003696cf187ea4e4b64d2a86378..ffac4f307242ead47f70420dc819d0e5bffe30eb 100644
--- a/alib2algo/src/regexp/simplify/RegExpOptimizeUnboundedPart.hpp
+++ b/alib2algo/src/regexp/simplify/RegExpOptimizeUnboundedPart.hpp
@@ -471,17 +471,19 @@ bool RegExpOptimize::Unbounded < SymbolType >::V2( UnboundedRegExpAlternation <
 	 */
 
 	ext::vector < const UnboundedRegExpElement < SymbolType > * > iterElements;
-	// cache iter elements because of operator invalidation after erase
+	// cache iter elements because of operator invalidation after erase only cache nodes that are not iterations (the nodes omitted may only come from situation like x** where the double iteration wil get optimized out elsewhere).
 	for( const UnboundedRegExpElement < SymbolType > & n : node.getElements ( ) ) {
 		const UnboundedRegExpIteration < SymbolType > * iter = dynamic_cast < const UnboundedRegExpIteration < SymbolType > * > ( & n );
 		if( iter ) {
 			const UnboundedRegExpAlternation < SymbolType > * inner = dynamic_cast < const UnboundedRegExpAlternation < SymbolType > * > ( & iter->getChild ( ) );
 			if ( inner )
-				for ( const UnboundedRegExpElement < SymbolType > & innerElement : inner->getElements ( ) )
-					iterElements.push_back ( & innerElement );
+				for ( const UnboundedRegExpElement < SymbolType > & innerElement : inner->getElements ( ) ) {
+					if ( ! dynamic_cast < const UnboundedRegExpIteration < SymbolType > * > ( & innerElement ) )
+						iterElements.push_back ( & innerElement );
+				}
 			else
-				iterElements.push_back ( & iter->getChild ( ) );
-
+				if ( ! dynamic_cast < const UnboundedRegExpIteration < SymbolType > * > ( & iter->getChild ( ) ) )
+					iterElements.push_back ( & iter->getChild ( ) );
 		}
 	}