Sayyiduna Umar bin Khattab (may Allah be pleased with him) narrates: The Prophet Muhammad (peace and blessings be upon him) said: "The reward of deeds depends upon the intentions and every person will get what he intended. So whoever emigrated for Allah and His Messenger, then his emigration is for Allah and His Messenger. And whoever emigrated for worldly gain or to marry a woman, then his emigration is for that for which he emigrated."