Added the sendMessage function.