Adi bin Hatim (may Allah be pleased with him) said that the Prophet (peace and blessings be upon him) said: "When one of you swears an oath about something, and then something else is better than it, let him give the expiation for his oath and do the better thing."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الأيمان / 19963