Fix for issue #8023

Can someone code review.
does this make sense?