added mx attribute logic