added message-sending functionality