Fixed bugs with sending message

Sending messages now works!