(The same is reported) from Ata and al-Hakam. They said: He should end his prayer with the salam and then join the imam in his prayer.