Sayyiduna Abdullah bin Mas'ud (may Allah be pleased with him) said: Make the prayer you catch with the imam the last part of your prayer.