Fixed bug with sending messages