Fixed a message sending bug