fixing bugs in message sender. Kudos to Ryan Dunn