ECMS-5998: Avoid the uncessary loop