Performing Maghrib Behind Congregational Prayer for `Isha’
Assalamu alaikum warahmatullahi wabarakatuh.I was late coming from a trip and on the way home I stopped by the masjid to pray maghrib. The jamaa made iqama for Isha. I prayed with jamaa but with the intention to pray maghrib. when the imaam the jamaa stood up for the 4th rakaa, i remained seated until they sat down for tashahud. when the imaam made salam, i did too. was i mistaken in not following the imaam? also would it have been better for me to pray isha with the jamaa and then make up maghrib? what is the proper way of doing the prayers in this situation. I travel a lot and usually try to stop by a masjid where available, and sometimes end up in these weird situations. I guess i need to learn the basic rules for qada of salat and also salat of masbooq.Jazak Allah Khair.