added function to send message