Yahya related to me from Malik from Nafi that a man asked
Abdullah ibn Umar, "Sometimes I pray in my house, and then catch the
prayer with the imam. Should I pray with him?" Abdullah ibn Umar said
to him, "Yes," and the man said, "Which of them do I make my prayer?"
Abdullah ibn Umar said, "Is that up to you? It is up to Allah. He will
decide on whichever of them He wishes."
Muwatta Malik Book 8, Hadith 10