It is not right.
If you choose to file as resident alien for tax purpose and married filling jointly, you CANNOT enjoy the $5000 treaty which is ONLY applied for non-resident for tax purpose.
Read publication 529 carefully and you'll find the answer.