Added export of sendMessage function