I said it would be dangerous if some parents just follow local courts' orders without checking IRS's procedure. What you have been doing is correct, e.g, filing 8332. Bottom line is to follow IRS rules if you want change dependant claims, if there is a conflict between court order and IRS rules.