functionality to send message