I broke my lease with my old apartment and the law is I am liable for damages but they have to find a tenant as soon as possible. Basically I have to pay them rent until they lease the apartment.

Here's the question: Can I deduct my security deposit from the my last payment? My lease doesn't say I forfeit my security deposit for breaking the lease. But it does say I cannot use the security deposit for paying rent. But I'm not paying rent, I'm paying damages (for lost rent). Isn't covering damages what the security deposit is for? Did I just come up with some clever tenant hack? (Keep in mind, I'm still going be paying thousands of dollars until they fill the unit.)