Al-Kahf - 18:81

فَأَرَدْنَا أَن يُبْدِلَهُمَا رَبُّهُمَا خَيْرًا مِّنْهُ زَكَاةً وَأَقْرَبَ رُحْمًا
[18:81]
So we desired that their Lord might give them in his place one better than him in purity and nearer to having compassion.
"So we desired that their Lord would give them in exchange (a son) better in purity (of conduct) and closer in affection.
And we intended that their Lord should change him for them for one better in purity and nearer to mercy.