One thing worse than going through a foreclosure is finding out you never should’ve lost your home in the first place.

In a regulatory filing, Wells Fargo revealed that a technical error kept homeowners from qualifying for a mortgage loan modification. According to the bank, 625 customers were denied a loan modification they should have quailed for. About 400 of those borrowers had their homes foreclosed.

“During the course of an internal review, we determined that an automated calculation error may have affected the decision on whether or not to offer or approve some mortgage modifications between April 13, 2010 and Oct. 20, 2015, when the error was corrected,” the bank said in a statement. “We’re very sorry that this error occurred and are providing remediation to the approximately 625 customers who may have been impacted.”

If there’s a chance you could’ve been affected by the glitch, consider speaking up. Customers can call the bank (877-645-1641) or fill out an online form and request a follow-up consultation.

More about the mishap

Miscalculations in loans modification reviews were common before and during the financial crisis. And they remain an issue today, says Alys Cohen, a staff attorney at the National Consumer Law Center.

Often, the mistakes are related to income and appraisal values, Cohen says. In Wells Fargo’s case, an error in the bank’s loan modification underwriting tool caused a miscalculation of attorneys’ fees. Though they weren’t charged for those fees, it appeared as though the qualified homeowners didn’t meet the requirements for loan modifications through the Home Affordable Modification Program and government-sponsored enterprises like Fannie Mae.

Though it was a small glitch, it had major consequences for many borrowers facing financial difficulties.

“You’re talking about families who were under unbelievable amounts of stress already from their economic situation,” says Julia Gordon, a national expert on foreclosure and mortgage-related issues. “Losing your home is extremely traumatic for a family and to have gone through that because of a mistake. I can’t imagine how I would feel if that happened to me.”

Wells Fargo has set aside $8 million for customers who were impacted by the error. Once the ongoing internal review is finalized, the bank will be reaching out to customers who have been affected.

Best course of action

At this point, there are still more questions than answers. It’s unclear why it took so long for Wells Fargo to discover a problem from a five-year period that ended in 2015. And it’s too early to say how Wells Fargo will determine how much money each borrower will receive.

If you were denied a loan modification you should’ve qualified for, consider getting advice from a consumer attorney, a legal services attorney or a housing counselor. Besides contacting Wells Fargo, you can complain to the bank’s regulator, the Office of the Comptroller of the Currency.

Be prepared to stand your ground and make demands, if necessary. You shouldn’t have to face tax consequences or give up your right to take legal action against the bank, if desired.

“Consumers should not have to waive their legal rights and that way they can accept the payment and then figure out whether more is needed,” Cohen says. “That was standard several years ago when the regulators found systemic problems in loan modification reviews and set up the independent foreclosure review process. Claims were not waived.”

If you’ve already lost your home to foreclosure, you’ll need to carefully consider your options as well.

“It’s not like you can go back and put somebody back in their house if that house already got sold to somebody else,” Gordon says. “But you can find out how much money the mistake ultimately cost them. You can try to fix whatever bad thing happened to their credit score as a result.”