When DEA agents closed in and arrested him, Dung "Danny" Bui was operating an elaborate marijuana grow house in suburban Reading.

He faced 10 years in prison if convicted on the four drug-related charges. But his attorney told him he was eligible for a reduced sentence. All Bui had to do was plead guilty to two of the counts: conspiracy to grow 1,000 plants and manufacturing within 1,000 feet of a school or park.

Bui agreed to the plea deal.

Unfortunately, his attorney was dead wrong. The law had been changed 18 years earlier.

Instead of having a few years knocked off his term, Bui was sentenced by a U.S. District Judge Legrome D. Davis to the mandatory minimum: a full 10 years. Davis also tacked on an additional 10 years of supervised release.

Stunned by the turn of events, Bui appealed his case.

On Oct. 20, the Third Circuit Court of Appeals in Philadelphia vacated Bui's sentence after finding the attorney was "ineffectual."

"The record clearly indicates Bui's counsel provided him with incorrect advice regarding the availability of a sentence reduction," the Court wrote. "There is a reasonable probability that, but for counsel's errors, he would not have pleaded guilty and would have insisted on going to trial."

According to court records, Bui was represented by Philadelphia attorney Richard J. Giuliani. Giuliani did not immediately return calls requesting comment.

In June 2008, DEA agents raided a split-level suburban rancher at 1307 Lorraine Rd. Agents uncovered a "large-scale" indoor marijuana grow operation which contained more than 900 plants. Bui, identified as the leader of the operation, was one of a dozen men arrested and charged, according to court documents.

After his arrest, Bui "admitted to the agents that the only reason they purchased that house was to … convert it into a marijuana grow facility," according to court records.

The attorney assured Bui and Bui's family that a legal "safety valve" would make Bui eligible for a reduced sentence. Bui was surprised when he received the full 10 years.

In the opinion, filed Oct. 20 and written by Judge Joseph Greenaway Jr., the Third Circuit issued a strongly worded reprimand.

"Counsel's lack of familiarity with an eighteen–year-old precedent and his erroneous advice based on that lack of familiarity demonstrate counsel's performance fell below prevailing profession norms," Greenaway wrote.