Hasan (may Allah have mercy on him) said: "Exception in divorce is permissible, whether the exception is mentioned before or after the divorce, as long as it is connected with the conversation."
Hadith Referenceسنن سعید بن منصور / كتاب الطلاق / 2994
Hadith Takhrij«أخرجه سعيد بن منصور فى «سننه» ترقيم الدرالسلفية برقم:، 1817، وابن أبى شيبة فى «مصنفه» برقم: 18320»