
171 Cal.App.2d 417 (1959)
JOHN LYKE et al., Appellants,
v.
C. E. PURSLEY et al., Respondents.
Civ. No. 5680. 
California Court of Appeals. Fourth Dist.  
June 17, 1959.
 Maas & Nairn for Appellants.
 Schwabacher & Cosgrove for Respondents.
 STONE, J. pro tem.  [fn. *]
 This is an appeal from a judgment in favor of defendants-respondents and against plaintiffs-appellants for balance of rent due for use of motel property. On August 9, 1955, respondents obtained a permit to construct a motel on property located near Rosamond in Kern County. While construction was in progress during January, 1956, appellants discussed leasing the premises from respondents. Approximately a month later all parties agreed upon the conditions *419 of a proposed lease for a five-year term. As the improvements had not been completed, the beginning date of the five-year term was not inserted in the lease. This was the situation on March 5, 1956, when appellants moved onto the property and paid respondents $3,000 advance rental. The lease provided no forfeiture clause, but did state that the $3,000 covered the rent for the last two months. The record indicates that respondents were in need of money to complete construction of the improvements and requested this advance payment of $3,000 before the lease had been completely executed. Beginning on March 5th, appellants lived on the property and helped with the construction work. Late in March or early in April the parties inserted March 20, 1956, in the lease as the beginning date of the five-year term. This date was used because that was when the first room was rented. Upon backdating the beginning of the term, the lease was completely executed.
 Although appellants rented some rooms beginning March 20th, the motel was only partially completed, and on May 20, 1956, an inspector for the Division of Housing found the premises incomplete and improperly constructed in 10 specific respects. Written notice of the defects and an order to correct them was served on respondents and appellants on June 6. The notice contained a statement that no permit to occupy the premises had been issued. By July 16, 1956, the defects had not been corrected and appellants refused to pay any more rent. Whereupon, respondents served them with a three-day notice to pay rent or quit the premises. Appellants countered on July 18 with a notice of rescission of the lease agreement upon the ground of failure of consideration. Respondents finally completed the premises and secured a license to occupy the same for motel purposes on August 14, 1956
 [1] Appellants' first assignment of error is that the trial court erred in denying them damages by reason of respondents' alleged fraud and misrepresentation. The gist of appellants' contention is that respondents agreed to have the motel completed at the time appellants took possession of the property. However, the evidence discloses that appellants were well aware of the condition of the property and the motel buildings when they went into possession. They viewed the premises when they negotiated for the lease in January, 1956, and also when the terms of the lease were verbally agreed upon in February, 1956. Most significant is the fact that they occupied the property several weeks before executing *420 the lease. Hence, there is ample evidence of a substantial nature to support the trial court's finding that appellants were not the victims of fraud or misrepresentation. An appellate court will not attempt to reweigh the evidence under such a state of the record. (Berniker v. Berniker, 30 Cal.2d 439 [182 P.2d 557]; Estate of Bristol, 23 Cal.2d 221, 223 [143 P.2d 689].)
 [2a] Appellants contend they had the right to rescind the lease because it was an illegal agreement. Their argument is that the state law, section 18600 et seq. of the Health and Safety Code, prohibits the use or lease of a motel without the approval of and licensing by the Division of Housing of the State of California. The undisputed evidence is that respondents secured a permit to construct a motel and that the premises were not completed or approved nor licensed for occupancy until August 14, 1956. Thus, the operation of the motel pursuant to the lease from March 20, 1956, to July 18, 1956, was contrary to law, as neither lessors nor lessees had obtained a permit or license. Not all contracts which involve an illegal or unlicensed undertaking are unenforceable. (Norwood v. Judd, 93 Cal.App.2d 276 [209 P.2d 24].) [3] The court must consider the nature of the undertaking in the light of the licensing statute. If the purpose of the regulation is primarily for public protection, public policy requires that contracts within the purview of the statute between unlicensed persons must be held to be unenforceable. (Loving & Evans v. Blick, 33 Cal.2d 603, 607 [204 P.2d 23]; Lewis & Queen v. N. M. Ball Sons, 48 Cal.2d 141, 150 [308 P.2d 713].) It is not necessary that the licensing statute contain a provision that contracts between unlicensed persons are unenforceable. [4] The court said in Orlinoff v. Campbell, 91 Cal.App.2d 382, at page 385 [205 P.2d 67]:
 "The Highway Carriers' Act is clearly one for regulation of the industry and not for revenue alone. There is no provision in the act that contracts made by unlicensed carriers are void or unenforceable. The question whether the courts should impose that additional penalty seems not to have been decided in any reported case. As we shall see, the broad basis for the doctrine that contracts of certain unlicensed persons are unenforceable is that the courts should not lend their aid to the enforcement of contracts where performance would tend to deprive the public of the benefits of the regulatory measures." *421
 [2b] A permit or license to occupy or lease a motel quite obviously is required for the protection of the public. Section 18600 et seq. of the Health and Safety Code places the duty of enforcing the provisions relating to motels under the jurisdiction of the Division of Housing. The permit for construction requires the filing of the proposed plans and specifications for approval, and they must meet certain health and sanitary requirements. The final permit to occupy or lease the premises issues only when those conditions have been fulfilled. In this case the application for permit to construct was approved August 9, 1955, and contained a written warning that the document was simply a permit to start construction, and that a separate permit or license was required before the premises could be occupied. The respondents gave possession to appellants on March 5, the lease was completed March 20, but the permit or license was not issued until August 14, 1956. On May 20, 1956, an inspector for the Division of Housing found the buildings incomplete and specified 10 defects. It is significant that of the 10 violations, eight pertained to health, sanitation and fire hazards. The well being of the public was being jeopardized by the failure of the parties to secure the necessary license to occupy and rent the motel. The record reflects that both lessors and lessees were aware of the need for a license or permit to occupy and operate a motel. Therefore, neither the appellants nor respondents can enforce the terms of the lease from March 20, 1956, to July 19, 1956, the period during which the lease was used as an instrument for the operation of the motel without a license. The court's finding that appellants were indebted to respondents for rent during the period that the premises were operated without a license is contrary to law and will not support the judgment.
 [5] The appellants' third specification of error is that the court erred in finding appellants' rescission of July 18 was ineffective because they failed to return everything of value they had received from respondents. According to the record, the only thing of value appellants received from respondents was the unpaid balance of rent for the period of March 20, 1956, to July 19, 1956. Since we have concluded that this amount cannot be collected by respondents because of the illegal nature of the occupancy, any failure to restore the rent would not vitiate the notice of rescission if otherwise valid.
 The question is whether or not the illegal occupation pursuant *422 to the lease precludes the appellants from recovering the $3,000 payment. The lease is dated January 21, 1956, the $3,000 payment was made March 5, 1956. Though dated January 21, 1956, the lease was not completely executed until the beginning date of the term was fixed as of March 20, 1956. The occupation of the premises pursuant to the lease did not commence until March 20, 1956. Since the lease, as such, was not an illegal agreement, and became so simply to the extent that it was used to facilitate the unlicensed use of the premises between March 20, 1956, and July 19, 1956, there is no legal restraint against appellants recovering the $3,000 advance payment made March 5, 1956. There is nothing in the record to indicate that the parties contemplated an illegal use of the premises at the time payment was made. In fact, the lease itself makes no mention of an uncompleted building and assumes a motel in being. Thus, if appellants have valid legal grounds for recovering the $3,000 down payment, aside from the question of illegality, they should prevail.
 Appellants properly pleaded a failure of consideration as well as fraud and misrepresentation. Although appellants worked on the buildings and grounds and otherwise aided in the work aimed at the completion of the improvements, they also frequently called upon respondents to complete the work. Some of the rooms were rented while others were under construction, and this state of turmoil continued from March 5, 1956, until July 18, 1956, at which time appellants gave notice of rescission. They cited, as reasons therefor, respondents' failure to complete the improvements and to secure a permit to operate the premises as a motel. They also specified respondents' failure to comply with the construction and repair orders of the State Department of Housing and of the Health and Safety Code of the State of California. Civil Code, section 1689, subdivision 2, authorizes a rescission upon the ground of failure of consideration. The record supports the appellants' reasons for rescission, in that the permit to lawfully operate the premises was not issued until August 14, 1956, nearly a month after the notice of rescission was served. As stated hereinbefore, the Division of Housing, Department of Industrial Relations, served written notice upon respondents and notified appellants of the defects in the building, together with a demand to correct them. The period of time appellants worked with respondents and gave them an opportunity to complete the premises, namely, from March 5, 1956, to July 18, 1956, constituted a reasonable period under the circumstances. *423 The fact that appellants worked with the respondents to complete the building and correct the defects does not preclude them from forever rejecting or rescinding the agreement. Furthermore, there is nothing in the record to indicate that the respondents were in any way harmed or damaged by reason of anything appellants did, nor by appellants' five-month delay in giving notice of rescission. In fact, the work appellants performed on the premises, as well as the rent they paid during the five-month period of delay, inured to respondents' benefit. [6] The facts of the case fall within the rule laid down in Esau v. Briggs, 89 Cal.App.2d 427, wherein the court said at page 438 [201 P.2d 25]:
 "Just how long plaintiff delayed in commencing the action after becoming aware of his right to rescind is not clear, but it was not longer than five months. The doctrine of laches does not rest entirely upon lapse of time, and it does not require any specified period of delay. (Neet v. Holmes, supra, (25 Cal.2d 447, 460 [154 P.2d 854].) [7] Whether a defrauded party has rescinded 'promptly' depends upon all the circumstances of the particular case. (Noll v. Baida, 202 Cal. 98, 109 [259 P. 433].) It does not appear, in the present case, that the defendant suffered any injury on account of plaintiff's delay." (See also Warfield v. Richey, 167 Cal.App.2d 93, 98 [334 P.2d 101].)
 The judgment is reversed.
 Mussell, Acting P. J., and Shepard, J., concurred.
NOTES
[fn. *]  *. Assigned by Chairman of Judicial Council.
