(CNN) - Illinois legislators weren’t thinking about harmless flash mobs, like countless renditions of the Harlem Shake or over-the-top marriage proposals, when crafting new legislation recently.

A bill which passed the state assembly on Friday and the state Senate earlier would allow judges to "impose an extended term sentence" when new-age “mob action” involves "electronic communication."

Democratic state Rep. Christian Mitchell, sponsor of the legislation, said he expects it to act as a deterrent to those considering participating in a flash mob attack like several along Chicago’s prestigious and bustling Magnificent Mile, a popular downtown shopping area.

“The old corporate gang structure as we knew it is gone,” he told CNN. “In many cases you’re seeing Twitter, Facebook and other social media being used to organize.”

He said the law is an important step but allowed it “is addressing a symptom of a larger problem” which requires improving family and school life for young people.