functionality to send messages