Verily actions are by intentions!!

The Messenger of Allaah sallallaahu `alayhi wa sallam ( may Allaah exalt his mention ) said:

“Verily actions are by intentions, and for every person is what he intended. So the one whose ‘hijrah’ (migration) was to Allaah and His Messenger, then his ‘hijrah’ was to Allaah and His Messenger. And the one whose ‘hijrah’ was for the world to gain from it, or a woman to marry her, then his ‘hijrah’ was for what he made ‘hijrah’ for.”

[Al-Bukhaari and Muslim]