Added transmitMessage function