A California man’s plan to flee the scene of a hit-and-run on Monday hit a snag when his foot got caught in his car’s steering wheel, police said.

The California Highway Patrol tweeted a picture Monday showing the man, who has not been identified publicly, hanging upside down from the window of his red and white pickup truck while trying to enter a code to obtain access to a gated community in Cathedral City.

When your DUI & fleeing from a Hit&Run. Then you lean over to the gate keypad, you fall over & your foot gets stuck in the steering wheel. Because your unable to help yourself, Cathedral City PD arrive, assist & take you to jail for DUI & Hit&Run pic.twitter.com/fD99dY3NIe — CHP Central LA (@CHPCentralLA) January 1, 2019

The man’s alleged escape plan failed when he fell out of his vehicle while trying to punch in the code. He realized he could not wriggle himself free from the tight space he was in when his foot got trapped in the steering wheel.

The Cathedral City Fire Department eventually came to the suspect’s rescue, cutting the steering wheel off to free him from the vehicle, KHOU reported.

Police said the man was not injured and was laughing at himself the whole time.

KABC reported that after fire officials freed the man, police arrested him on suspicion of drunk driving and hit-and-run and hauled him off to jail.