If Ferguson had remained the lessor, he would have been liable for failure to return the deposit upon the expiration of thirty days following termination of the occupancy. G. L. c. 186, § 15B(4); see also (6)(e) & (7). Section 15B(5), as appearing in St. 1978, c. 553, § 2, provides that when a lessor sells the premises to another, he shall transfer the deposit to the successor; in case he fails to do so, the successor “shall . . . assume liability for payment of the security deposit to the tenant in accordance with the provisions of this section”; with the proviso that “if the tenant still occupies the dwelling unit for which the security deposit was given, said successor . . . may satisfy such obligation by granting the tenant free occupation and use of the dwelling unit for a period of time equivalent to that period of time for which the dwelling unit could be leased ... if the security deposit were deemed to be rent... .’’See also § 15B(6)(d)&(7).