The California state legislature passed a bill Monday that ensures homeowners, not lenders, receive at least some of the interest on insurance payouts for homes destroyed or damaged by natural disasters.

The legislation comes after thousands of homeowners lost their residences in January’s historic wildfires in Southern California. Following such a loss, insurers send checks typically made out jointly to both the homeowner and the mortgage lender or servicer. The lender will then deposit the funds into an escrow account, where it earns interest that the lender could keep.

California Assemblymember John Harabedian, D-Pasadena, the author of the bill, said he is fighting to change that after hearing from his constituents about their struggles getting insurance payouts released from their lenders.

“If the homeowners are not given their money right away, the interest on that money, which the banks and the mortgage lenders are holding onto and earning [interest on], should be paid to the homeowner, not the banks,” Harabedian told CNBC. “The more we looked into this, the more we realized that this was a huge problem across the board.”

The bill will now head to Gov. Gavin Newsom’s desk to be signed into law.