If you’re going to commit a crime, make sure you don’t have a court appearance the same day.

That’s a mistake Adam Tyler Smith made before police arrested him on allegations he flashed two women in downtown Senoia, Detective Michelle Worden told The Atlanta Journal-Constitution.

The 31-year-old was at the courthouse for a traffic violation on March 14, Worden said.

“He was late, and the judge had him sit on the front bench,” Worden said. As the judge advised Smith and a few others of their rights, Worden said the man fell asleep.

Smith was eventually awakened, but immediately after leaving court, Worden said he flashed two women — one who was meeting a friend for lunch and the other who was in a nail salon — hours apart.

In the first incident, about 11:55 a.m., Smith walked toward the woman sitting in the salon, flashed his genitals and shook them in a lewd manner, according to a police report obtained by The AJC. Nearly three hours later, Smith allegedly approached another woman, again flashed his genitals and swung them while looking at her. The victim said he didn’t touch her with them.

Authorities searched the area for Smith both times, but didn’t find him. The women later identified Smith from surveillance footage, Worden said.

“When we went through video footage, we noticed he matched the description of what the two victims gave us,” she said.

When Worden took a closer look, she also recognized Smith from court: “I had to tell him to wake up in court and knew what he had on: gray sweatpants, a gray hoodie and red shoes.”

Worden then asked the court clerk for Smith’s name.

Authorities took out warrants for Smith, who was arrested April 4 during a traffic stop. He faces two counts of indecent exposure. He has since bonded out of jail.

In other news:

Mom Busted At Border With $1 Million In Drugs, Van Full Of Kids