SAN FRANCISCO (CBS SF) — In a city where real estate prices are setting national records, San Francisco’s mayor is vowing to punish cheaters in the city’s affordable housing program following a KPIX 5 investigation.

For decades, people have been gaming the system in order to buy coveted below-market-rate (BMA) units set aside for low- to middle-income families.

READ MORE: UPDATE: Flood Waters Shut Down Lanes Of I-880; Alameda's Harbor Bay Parkway, Silverado Trail In Napa

Wednesday, Mayor Ed Lee said his office needs to do more to defend these rare apartments in the midst of a housing crisis.

“They’re going to pay for it,” vowed Lee. “I want them to be punished but I also want that practice to stop.”

KPIX 5 has been chasing down BMR cheaters for the past two months, finding cases of people lying on their applications, renting out their units on Airbnb, or just leaving them empty, all of which are illegal.

Mayor Lee’s Office of Housing oversees the program. On Wednesday, he admitted it’s not being run very well.

We asked, “Do you think it’s being run adequately?”

“No, we can do a better job,” Lee responded.

BMR owners are supposed to live in their units. But we found one owner, Caroline Novak, miles away at a home she purchased two years ago for $2.25 million in the exclusive Redwood City community of Emerald Hills.

She claimed she was “just staying there for a couple of days.”

A unit at another building in the city’s Potrero Hill neighborhood belongs to Margarita Popova. No one answered the door, but instead we found her out in the Avenues at a nearly $1.5 million home.

READ MORE: Atmospheric River: Santa Cruz County Officials Lift Evacuation Orders For CZU Fire Burn Zone

Neighbors say Popova has been in the house for years, but she insisted otherwise. However, we found an ad on Craigslist asking for $3,100 a month to rent her BMR.

Then there’s Amy Gussin. The investment banker was illegally renting her BMR unit on Airbnb for $149 a night for several years while living in a multi-million dollar condo she owns in the Millenium Tower.

KPIX 5 compiled a list of complaints about BMR owners; most were obtained through a public records request.

In a random door-to-door survey we found cheaters in almost every building, months after anonymous neighbors ratted them out.

John Cote, spokesman for the city attorney’s office, says his office is cracking down.

“I think in any instance where you have someone gaming the system, when we’re talking about affordable housing, it’s substantial, it’s wrong and it shouldn’t happen,” said Cote.

The city attorney’s office has filed three lawsuits and just reached a settlement with Gussin.

But one of the three cases the city filed could have been prevented. Rita Zakhrabova is being sued by the city for owning two BMRs. The mayor’s Office of Housing allowed her to illegally purchase the second one. Now they’re spending city resources to prosecute their own mistake.

“You have to have a staff paying a lot more attention,” said Lee. “By paying attention to it on your reports we have to do better. We have to do our best. I hope we hear less and less.”

MORE NEWS: Atmospheric River: San Francisco Bay Area Takes Wild One Day Ride From Extreme Drought To Flooded Streets

Lee said the goal is to eventually have 30,000 BMRs available to low- and middle-income families.