فَاَرَدْنَآ اَنْ يُّبْدِلَهُمَا رَبُّهُمَا خَيْرًا مِّنْهُ زَكٰوةً وَّاَقْرَبَ رُحْمًا ( الكهف: ٨١ )
Faradnaa any yubdila humaa Rabbuhumaa khairam minhu zakaatanw wa aqraba ruhmaa (al-Kahf 18:81)
So we intended that their Lord should substitute for them one better than him in purity and nearer to mercy. (Al-Kahf  : 81)
1 Mufti Taqi Usmani
We, therefore, wished that their Lord would replace him with someone better than him in piety, and more akin to affection.