Sayyiduna Abu Umamah (may Allah be pleased with him) said: It was the people's practice that when a man entered the mosque and found them praying, he would ask the one beside him, who would tell him how much of the prayer he had missed so that he could make it up; then he would stand and pray with them. Then one day Sayyiduna Mu'adh (may Allah be pleased with him) came, and the people signalled to him that he had missed such and such of the prayer, but he refused to pray (it first himself); he prayed (with the imam), and then afterwards he prayed what he had missed. When this was mentioned to the Messenger of Allah (peace and blessings be upon him), he (peace and blessings be upon him) said: "Mu'adh has done well, so you too do as he did."
Hadith Referenceالمعجم الكبير للطبراني / باب الصاد / 7819