Is the X command formatted properly? I don't use it and just copied what you wrote for it, so I don't know if it's properly formatted.

Try removing the . in front of msg and see if you are at least sending the message out.