delivered the opinion of the court:
This appeal arises out of an amended third-party complaint filed by Jacob Shaw, defendant and third-party plaintiff, against Cigarette Service Company, Shaw’s former employer and third-party defendant, to recover overtime compensation allegedly due Shaw as an employee. The amended complaint consisted of two counts. Count I was based on the terms of a collective bargaining agreement between the defendant and its employees. The second count was based on the Fair Labor Standards Act. Pursuant to Cigarette Service Company’s motion, the trial court ordered that both counts of the amended third-party complaint be dismissed. Shaw now appeals only from that part of the order dismissing count I of the amended third-party complaint.
Shaw contends that the trial court erroneously dismissed count I of the amended complaint because it stated a cause of action and because there existed a question of fact which Shaw was entitled to have decided by jury in accord with his jury demand.
We reverse in part and remand.
Shaw alleged in relevant part in count I of his verified amended third-party complaint that from July of 1974 to November of 1975 he was employed by Cigarette Service Co. as a vending machine route serviceman at an hourly salary of *5.95 per hour through October 4,1975, and *6.60 per hour through November 4, 1975; that during the entire period of defendant’s employment, the terms of such employment were governed by a contract between Cigarette Service and the labor union of which defendant was a member; that a provision of the contract provides that “all work performed by hourly employees in excess of eight hours per day, or forty hours per week, shall be paid for at the rate of time and one-half the regular hourly rate”; and that defendant, with the exception of one week during the entire period of his employment, worked 60 hours per week. Count I of the amended third party complaint goes on to allege that Cigarette Service owes Shaw *12,017.50 in overtime pay.
Pursuant to section 48 of the Civil Practice Act (Ill. Rev. Stat. 1977, ch. 110, par. 48), Cigarette Service filed a motion to dismiss the third-party complaint. In its motion to dismiss, Cigarette Service alleged that Shaw was hired pursuant to article VIII of the agreement with Shaw’s union and was a commission employee who was not entitled to overtime compensation. Attached to the motion was a copy of article VIII which provides in part:
“WAGES Effective November 14,1971, the following commission rates shall be paid to servicemen who are paid on a commission rate basis instead of an hourly rate. Servicemen who were paid on a commission rate basis prior to October 1,1969, shall continue to receive commission pay.
Servicemen who were paid on an hourly rate basis prior to October 1,1969, shall have the option of choosing with agreement of Employer to be paid commission rather than the hourly rates provided that once a serviceman has chosen to be paid commissions he shall continue to be paid commissions and cannot revert back to hourly rate of pay, after sixty (60) days.”
Also attached to the motion to dismiss was the affidavit of Stephen Bloom, the president of Cigarette Service. That affidavit states that during Shaw’s period of employment with Cigarette Service, Shaw was employed as a commission employee pursuant to the labor contract and that Shaw’s compensation, as well as that of all servicemen hired after October 1, 1969, was determined on a commission basis in accordance with article VIII of the contract.
Shaw filed a response to the motion to dismiss to which he attached his own affidavit. That affidavit states that during Shaw’s period of employment with Cigarette Service he was employed as an hourly paid vending machine route serviceman; that during the entire time of that employment, Shaw, although not required, was permitted to sell merchandise on commission; that when he did sell merchandise, commissions became due him in addition to his hourly earnings; that when he did not sell merchandise, he was entitled to only his hourly salary; and that the statement in Stephen Bloom’s affidavit that Shaw’s entire salary was determined on a commission basis, was untrue.
The trial court, after considering the pleadings and above affidavits, dismissed the third-party complaint with prejudice. Shaw contends that the trial court erred in this ruling because count I of the third-party complaint stated a cause of action and there existed a genuine issue of fact which he was entitled to have decided by a jury.
The motion to dismiss the amended third-party complaint was made pursuant to subsection l(i) of section 48. That subsection states:
“(1) Defendant may, within the time for pleading, file a motion for dismissal of the action or for other appropriate relief upon any of the following grounds. If the grounds do not appear on the face of the pleading attacked the motion shall be supported by affidavit:
# # #
(i) That the claim or demand asserted against defendant is barred by other affirmative matter avoiding the legal effect of or defeating the claim or demand.” (Ill. Rev: Stat. 1977, ch. 110, par. 48(1) (i).)
The additional affirmative matter presented in the motion to dismiss was the union contract and the affidavit of Mr. Bloom.
In considering a motion to dismiss, the trial court must search the record and consider all relevant facts. If a material issue of fact is raised, the court will deny the motion. (Pennington v. Jones (1977), 46 Ill. App. 3d 65, 360 N.E.2d 566.) Moreover, subsection 3 of section 48 states in relevant part:
* * If a material and genuine disputed question of fact is raised the court * * * shall so deny [the motion] if the action is one in which a party is entitled to a trial by jury and a jury demand has been filed by the opposite party in apt time.” (Ill. Rev. Stat. 1977, ch. 110, par. 48(3).)
Shaw filed a timely jury demand and therefore if a material and genuine disputed question of fact was raised, the trial court erred in denying the motion.
In arguing that the trial court correctly dismissed the amended third-party complaint, Cigarette Service relies on the union contract. It argues that, as a matter of law, Shaw was not entitled to overtime compensation since he was a commission serviceman whose employment was controlled by article VIII of the union agreement. Cigarette Service points out that article VIII provides that servicemen who were paid on an hourly basis before October 1,1969, have the option of choosing whether to continue to be paid on an hourly basis or to be paid on a commission basis and that once that serviceman chooses to be paid commission, he cannot revert back to hourly pay. Cigarette Service goes on to argue that servicemen hired after October 1,1969, are not given this option and that all servicemen hired after October 1, 1969, are paid commissions according to the following arrangement: a weekly base wage plus commission on merchandise they sell, but if the base wage plus commission does not equal a certain weekly minimum, then they are paid the weekly minimum.
It is true, and Shaw so admits in his third-party complaint, that the terms of his employment were governed by the union contract. Moreover, article VIII of the union agreement mentions two categories of pay, commission and hourly. On its face, article VIII of the union contract creates no hybrid category of union employees who receive an hourly wage as well as commissions on merchandise they sell. However, on its face it does not specifically exclude such a category either. Moreover, the union contract does not specifically refer to employees hired after October 1,1969. While we agree with Cigarette Service that in light of the fact that Shaw admitted that his employment was governed by the union contract, a sensible reading of the contract should include employees hired after October 1,1969. We further agree that it is sensible to interpret the contract as creating only two categories of pay, hourly and commission. However, we cannot say, in light of the contradictory affidavits that Shaw was not an hourly employee who also received commissions. We believe, considering Shaw’s affidavit and the fact that article VIII does not specifically mention employees hired after October 1,1969, that based on the record before us a genuine and material issue of fact exists concerning Shaw’s wages. We therefore reverse that part of the order of the trial court dismissing count I of the amended third-party complaint and remand the cause for proceedings consistent with this opinion.
Order reversed in part; cause remanded.
GOLDBERG, P. J., and O’CONNOR, J., concur.