send message logic