totally rewriting the send-message.sh script