Fix message sending functionality