So let's say you buy a house that needs a lot of work with the intention of doing a quality rehab job and selling it for a profit. But several weeks after closing, you learn that the city can demolish the building and strip you of ownership because the seller failed to bring the property up to code.

That's what's happening to Andrew Dick, who paid $19,900 for a vacant, foreclosed fixer-upper on St. Paul's East Side. A Feb. 14 Star Tribune story recounted how Dick bought the property in late November but has been told to hold off on any improvements because the seller violated a new city ordinance.

That's an unintended consequence of a well-intentioned law. To correct it, the St. Paul City Council should grant a waiver and make adjustments to accommodate responsible buyers.

Last year, St. Paul officials passed an ordinance that requires the most run-down vacant houses to be inspected and brought up to code before they can be sold. The sensible idea was to hold banks and mortgage companies responsible for the growing number of foreclosed and vacant properties in the city.

Called "point-of-sale" ordinances, the rules are intended to maintain quality housing when these scenarios occur: A person buys a fixer-upper and doesn't have the funds to make necessary repairs; a speculator purchases vacant houses only to flip them after making minimum fixes, or an irresponsible landlord sells his dilapidated building to another bad landlord. All of those situations can perpetuate blight and neighborhood decline.

When Dick bought the East Side home, he believed the home was in Category 2 condition, based on a Truth of Sale report completed last August. The ordinance says that Category 3 homes -- those with the highest number of code problems -- must be repaired before an owner can sell. When a subsequent inspection put the house in Category 3, notification was sent to the owner, a bank in Florida. That letter, however, did not state that the home could not be sold. Dick learned of the change of status to Category 3 in early January, and he said the city told him the ordinance hadn't been enforced before December. Because he closed in November, he thought he was safe. He bought the home and put up a $5,000 bond to show he was serious about the renovation. And he has a track record of fixing up other East Side homes.

Some council members believe an exception should be made because having a responsible developer is better for the neighborhood than creating a vacant lot. Other council members worry that granting an exception for one would dilute the law.

Yet the council already allows an exception. Confident that they will do quality rehab work, the city's Housing and Redevelopment Authority and neighborhood Community Development Corporations can purchase Category 3 properties. That same criteria could be applied to individual buyers.

The council should allow Dick to proceed with his renovation. Then the city should do one of two things: either allow case-by-case waivers or develop criteria to define "qualified" buyers of vacant homes. And the law needs more enforcement teeth, including penalties for selling a vacant property that's not up to code.