My question involves landlord-tenant law in the State of: Iowa

My wife and I purchased a new home to take advantage of the homebuyer's credit near the end of our year-long lease. Our deposit was a full month's payment and our lease officially terminated on Aug 1st. When we moved into the new house in May, we also paid June's rent. As July approached, we called the landlord and asked if we could checkout and use the security deposit in lieu of our last month's rent. The landlord said that this was possible, assuming everything went alright at checkout.

Well, we checked out and there was no damage so he agreed to use the security deposit minus a $100 deposit on our part to ensure we kept the utilities turned on. We agreed and went about our business.

We received our utility bill recently and discovered a spike in usage at the old apartment. It turns out the landlord leased the apt and the new tenants moved in sometime around July 22nd. The landlord agrees that we are due some money for the utility bill but claims that as soon as we handed over the keys we were liable for the full security deposit. I believe we should be refunded a portion as our lease was terminated as soon as the new tenants occupied the unit.

I would appreciate any legal advice any of you might have. Who is right here?