Updated send message logic