The Role of Imam in Hadith
Imam Muhammad Baqir says: "Any group of people who accepts a tyrant ruler will face the wrath of Allah even if it happens to be pious. On the contrary those, who accept a just Imam appointed by Allah, deserve His forgiveness and mercy even if they happen to be of bad conduct". (al-Kafi, vol. I.)
From this important tradition it is proved that the thing which is more important than deeds is the method and the path. Suppose a driver who is experienced, wise, and healthy will drive his bus safely to its destination irrespective of the fact that some of the passengers have thrown peels of oranges and bits of cigarettes in the bus and are in dirty clothes with torn shoes etc. If the bus driver happens to be a blind or insane person then the passengers of the bus despite wearing good clothes and shoes will be heading towards disaster. Thus in any journey the importance is of the leader who leads one to the destination. The Holy Qur'an says:
Who strays more than one who follows his lust without guidance from Allah. (Surah al-Qasas, 28:50)
In the context of this verse we come across a tradition which says: "Whoever adopts his religion according to his own inclination and opinion and does not follow a true Imam, according to this verse is a misguided person". (al-Mizan, vol. XVI, p. 56)
Another tradition says: "One, who worships much, but does not follow a true Imam, is certainly a misguided person, and Allah does not accept his worship". (al-Kafi, vol. I.)
Reference: ImamReza.ne