It is narrated from Sayyiduna Abdullah bin Mas'ud (may Allah be pleased with him) that he said: "Among those before you there was a man who lived among a disbelieving people, while near them there was also a town of righteous people. That man said (to himself): I have remained in a state of disbelief for a long time; now I will certainly go to this righteous town so that I may live as one of them. So he set out, and he was still on the way when death overtook him. The angel and Satan disputed about him; Satan said: I have more right to him, and the angel said: I have more right to him. Then Allah Almighty appointed one of His hosts for them (to judge), who said: Measure the distance between the two towns; whichever town he is nearer to, let him be counted as one of its people. When they measured, they found him nearer to the town of the righteous, so he was included among those righteous people." Imam Ishaq recorded this hadith with a sahih (authentic) chain.