fix sending of messages