
337 So.2d 1277 (1976)
James G. BARBEE
v.
UNITED DOLLAR STORES, INC.
No. 48896.
Supreme Court of Mississippi.
October 12, 1976.
Thomas J. Wiltz, Paul Stephen Minor, Biloxi, for appellant.
Eaton, Cottrell, Galloway & Lang, L. Kenneth Krogstad, Gulfport, for appellee.
Before GILLESPIE, C.J., and ROBERTSON and LEE, JJ.
GILLESPIE, Chief Justice, for the Court:
United Dollar Stores, Inc. (United), an Arkansas Corporation, sued James G. Barbee in the Circuit Court of Harrison County to recover for merchandise sold and a two and one-half percent royalty payment on the gross receipts of a franchised retail store operated by Barbee. From an adverse judgment entered against Barbee, he appealed.
United sued to recover $12,117.49 on a sworn open account for goods sold Barbee. This figure included $719.71 in interest or service charges which during the course of the trial United relinquished its demand. *1278 It also sought recovery of a two and one-half percent franchise fee alleged to be due under a franchise agreement between the parties based on the gross sales of Barbee in a retail store. Barbee answered and filed a counterclaim in which he sought damages allegedly resulting from the sale by United to Barbee of defective and inferior merchandise, plus $1500 Barbee had paid United as a franchise fee for the privilege of operating a United Dollar Store in Gulfport, Mississippi.
At the termination of the trial, the court ruled as a matter of law that (1) United was entitled to recover on its open account, (2) United failed to prove its case as to the two and one-half percent royalty, (3) United had breached the franchise agreement but specific damages were not proven by Barbee, and that (4) Barbee was entitled to recover the $1500 franchise fee. The net result was a judgment in favor of United against Barbee for $9,897.78. The court also found that United was a foreign corporation not qualified to do business in this State and that it was doing business in this State in violation of Mississippi Code Annotated section 79-3-211 (1972), but declined to dismiss United's suit because Barbee had waived his right to invoke the penal effects of Mississippi Code Annotated section 79-3-247 (1972) by filing a counterclaim. United cross-appealed and urges that the trial court erred in holding that United was doing business in this State.
In our view of the case, the answer to two questions disposes of the case.

I.
Was United doing business in this State in violation of Mississippi Code Annotated section 79-3-211 (1972)?
United is an Arkansas corporation. It has not qualified to do business in this State. Code section 79-3-211 provides that a foreign corporation shall not have the right to transact business in this State until it shall have procured a certificate of authority from the Secretary of State. Code section 79-3-247 bars such foreign corporation from transacting business in this State without a certificate and from maintaining any action in the courts of this State.
United has a chain of franchised retail stores. Barbee and United entered into a retail dealer agreement on November 25, 1970, wherein United granted Barbee a franchise to operate in Gulfport, Mississippi, a franchised retail store in accordance with the terms of the agreement. This is a lengthy contract, giving United a large measure of control over the operation of the store to be operated by Barbee and provides for service fees and the payment to United of a continuing royalty of two and one-half percent of the gross monthly receipts excluding taxes on the total volume of sales. Barbee was required to give monthly written reports of business transacted each month by the 10th day of the following month. United retained the sole right to set all specifications relating to design, decor, furnishings, fixtures, signs and identifying materials, uniform record keeping practices, and other matters as may be required in the operating policies of United. All merchandise sold in the store shall be purchased from United, or from sources approved by United. Barbee agreed to advertise and promote the United program of merchandising. United agreed to provide all training service, information, techniques, and guidance sufficient to enable Barbee to operate the store. United agreed to stimulate the business through state and regional advertising and public relations campaigns. Barbee was required to carry comprehensive public liability insurance and products liability for certain limits and to add the name of United as an additional insured, failing which, United had the right to obtain and pay for such insurance and charge it to Barbee. There are many other provisions of the contract.
United has other stores in Mississippi, including one at Vicksburg, three in Jackson, and one each in Prentiss, Greenville, Clarksdale, Grenada, Rolling Fork, Greenwood, and McComb. In connection with the opening of Barbee's store at Gulfport, United made a design layout of the store, United's representative sketched what fixtures *1279 they wanted and where they wanted the fixtures built. United delivered the merchandise to the store, interviewed prospective employees, ran ads in the newspaper for employees, took applications, and selected eight employees. Two representatives of United instructed Barbee's employees how to arrange and price the merchandise. In this manner, United's employees stocked the store with merchandise. United also furnished some of the fixtures and all of the merchandise and charged them to Barbee. After Barbee's store began operating, United worked out an arrangement for the exchange of goods between other Dollar Stores and Barbee's store. United furnished and mailed out catalogues.
In view of United's contract rights to control virtually the entire operation of the store, its actual stocking of the store, the hiring and training of employees, arranging the layout of the fixtures and of the goods, the control of advertising, and the right to sell to Barbee all of the merchandise to be sold in the store, or approve its purchase elsewhere, and the fact that United was receiving two and one-half percent of the gross of the entire business, less taxes, clearly indicates that United was doing business in the State of Mississippi in violation of the statute.
On the authority of Trane Company v. Taylor, 295 So.2d 746 (Miss. 1974), and Century Brick Corporation of America v. Carroll, 247 Miss. 514, 153 So.2d 683 (1963), we hold that the trial judge was correct in ruling that United was doing business in the State of Mississippi within the meaning of Code section 79-3-211.
Because United was doing business within the meaning of the statute, it is not exempt from the penalty of the statute because of the interstate aspects of its business. It is well settled that a state cannot require a foreign corporation to obtain a certificate to do business if that corporation is engaged solely in interstate sales. Such a limitation is based on the Commerce Clause of the United States Constitution, and is reflected in our qualification statute. Section 79-3-211 provides that "... a foreign corporation shall not be considered transacting business in this state . ." if it is engaged in interstate commerce. United contends that its activities were in the nature of interstate commerce, and, therefore, it is exempt from the penal effects of Code section 79-3-247. United's contention is without merit as there is no question that a state can require a foreign corporation to obtain a certificate if it is engaged in intrastate activities as well as interstate activities. Eli Lilly & Co. v. Sav-On-Drugs, 366 U.S. 276, 81 S.Ct. 1316, 6 L.Ed.2d 288 (1961).
United urges that the holding in Allenberg Cotton Co., Inc. v. Pittman, 419 U.S. 20, 95 S.Ct. 260, 42 L.Ed.2d 195 (1974), should control the instant case. In Allenberg, the United States Supreme Court held that where the degree of a foreign corporation's business activity is limited to contracts, arranged through independent brokers, to purchase cotton from local farmers, and where the cotton is temporarily stored in local warehouses for classification purposes, then the foreign corporation's activities are not sufficiently intrastate as would require qualification. The Court stated that these local ties were nothing more than "... fleeting events [of an] ... integral first step in a vast system of distribution of cotton in interstate commerce." 419 U.S. at 26, 95 S.Ct. at 264, 42 L.Ed.2d at 201.
United's previously described business activities within this State are far greater than the "fleeting events" found in Allenberg.

II.
Did the trial court err in finding that Barbee was estopped from raising the bar of the statute because he filed a counterclaim against United?
Waiver is defined in 28 Am.Jur.2d, Estoppel and Waiver section 154, at 836 (1966), as "... the voluntary and intentional relinquishment of a known right..." United filed its suit and alleged that it was "a foreign corporation, licensed and qualified *1280 to carry on and conduct business in the State of Mississippi." This was an incorrect statement  United was not qualified and licensed to do business in the State of Mississippi. In response to this pleading, the truth of which Barbee had a right to rely on, Barbee filed his responsive pleadings, including a counterclaim. After Barbee learned that United was not qualified to do business in the State, he moved for leave to amend in order to invoke the provisions of the statute barring United from maintaining an action in the courts of this State. No case is cited and United does not argue on this appeal that Barbee waived the right to invoke the statute. This question is discussed in 36 Am.Jur.2d, Foreign Corporations section 588, at 585 (1968), as follows:
In jurisdictions in which an allegation of compliance with the laws is required on the part of the plaintiff corporation, its complaint or petition is demurrable if it fails to allege that fact. And even in a jurisdiction where such an allegation is not required, if its complaint or other pleading shows that it has been doing business in violation of a statute requiring it to qualify therefor, and if such violation is, in the particular jurisdiction, a bar to the maintenance of an action, a demurrer to such pleading may be properly sustained. In any case, such objection, unless raised by a timely and proper pleading, is to be deemed waived; it cannot be raised for the first time on appeal. It has been held, however, that the fact that the defendant has set up a counterclaim in the answer, asking for the damages resulting from the breach of the contract by the plaintiff, does not operate as a waiver of his right to ask for an abatement of the action on the ground that the plaintiff had failed to comply with the conditions of doing business in the state.
We hold that Barbee had a right to rely upon the truth of United's pleadings and by relying thereon did not waive his right to invoke the statute.
For the reasons stated, on direct appeal the action of the trial court is reversed insofar as it held that Barbee had waived the right to invoke the statute barring United from maintaining an action in the courts of this State. It follows the judgment against Barbee is reversed.
On cross-appeal, that part of the judgment holding that United was doing business in Mississippi is affirmed. The second assignment of error on the cross-appeal is disposed of as a result of the reversal of the trial court as already stated.
Because United could not maintain an action in the courts of this State, the court should have dismissed the suit at United's cost. Therefore, we enter an order here dismissing United's suit and vacating the judgment entered in the court below and dismissing Barbee's counterclaim.
REVERSED ON DIRECT APPEAL AND RENDERED; AFFIRMED ON CROSS-APPEAL.
PATTERSON and INZER, P. JJ., and SMITH, ROBERTSON, SUGG, WALKER, BROOM and LEE, JJ., concur.
