Lindsay Lohan appeared in an LA court on Friday and was told by the judge that unless she cleaned up her act she would be put behind bars.

Lohan was arrested in 2007 for driving under the influence and was ordered to undergo an alcohol education program for one year and a half.

The actress was called back into court Friday because she had not been following that program.

Lohan’s legal counsel argues that she was not able to do so due to work commitments.

Failure to comply means that another year has been added to Lohan’s probation period

Judge Marsha Revel, who presided over the case, laid out in no uncertain terms what Lohan needed to do.

"This is the last time we are going to be talking about re-enrolling and doing what you need to do,”” the judge was quoted as saying in Britain’s Telegraph newspaper.

“This has to be a top priority. I would love to congratulate you rather than admonish you."

The judge said that if she could not complete the program she would be sent to jail and added that Lohan would have to request court approval for any leave of absence that would last more than three weeks.

The judge also allowed Lohan to travel to New York for a charity event next week, but told her not to request to leave the state or country.

"I'm going to know about it because your whole life is followed,” said Judge Revel.