It is narrated from Sayyiduna Sahl bin Sa'd al-Sa'idi (may Allah be pleased with him) that the Messenger of Allah (peace and blessings be upon him) said: "The intention of the believer is better than his deed, and the deed of the hypocrite is better than his intention, and everyone acts according to his intention. When the believer does a deed, a light shines in his heart."
Hadith Referenceالمعجم الكبير للطبراني / باب السين / 5921