fixed message sending bug