The Massachusetts legislature passed a bill that would prevent financial institutions from foreclosing on properties when the expected recovery is less than what could be obtained through a loan modification.

The Massachusetts Senate passed the legislation – House Bill 4323 – unanimously on Thursday, just one day after it made its way through the House.

The bill now goes back to the House, and then the Senate, for enactment before heading off to the governor's office for final approval.

The legislation essentially stipulates that unless a foreclosure proves to be more financially beneficial than alternative methods, a lender is required to modify a troubled loan.

On the other hand, if the calculation shows a foreclosure netting a higher recovery than a modified mortgage, the lender must notify the borrower and provide them with a complete written summary of the net present value analysis that informed the foreclosure decision.

The bill also attaches penalties for documentation and processing errors in the foreclosure process.

Furthermore, the legislation stipulates that a creditor is in violation of the law for foreclosing on a property without having possession of a "valid, written, signed and data assignment evidencing the assignment of the mortgage."

A creditor also would be violating the provisions of the bill for publishing a foreclosure notice when the creditor knows or should know that the mortgagee is neither the holder of the mortgage nor the authorized agent.

In addition, the bill requires a task force of 13 individuals from the banking and legal communities to study foreclosure prevention and nationwide mediation efforts to inform future legislative discussions on the topic. The study is expected to include an analysis of how feasible it is to allow a foreclosed homeowner to occupy a foreclosed property until a binding purchase or sale is complete.