LOUISVILLE, Ky. (WDRB) -- Kentucky Attorney General Andy Beshear is warning that a recent ruling by the U.S. Supreme Court places children in more danger online.

In a unanimous opinion, the court threw out a North Carolina law that banned convicted sex offenders from social media sites that permit minors to join.

The justices said the law prohibiting them from sites such as Facebook, Twitter, Instagram and Snapchat was overly broad and violated the free speech rights of sex offenders.

Beshear said the ruling in the Packingham v. North Carolina case allows more potential child predators on social media and makes it more difficult to stop them.

“This Supreme Court ruling is very unfortunate in that it will allow thousands upon thousands of registered sex offenders to freely roam these networking sites,” Beshear said.

Beshear said Kentucky's law is very similar to North Carolina's, and the ruling is already undercutting efforts by the state's cybercrime units to catch child predators.

“This Supreme Court ruling is already being brought up by registered sex offenders that we catch being online,” he said.

Beshear sent a letter to key lawmakers expressing the need to tighten Kentucky's law and offering to work with them on crafting legislation. He believes a more narrow statute would be constitutional, one that would ban sex offenders only from sites aimed at children, such as Disney or Nickelodeon.

“We also need to outlaw a registered sex offender trying to use any social media site to collect information on children or to directly communicate with children,” Beshear said.

Sen. Whitney Westerfield, the chairman of the Senate Judiciary Committee, said he has not yet read the ruling or Beshear's letter, but if there's a problem, he wants to fix it.

“It does give me some concern," Westerfield said. "Obviously, our ultimate priority should be protecting children that are on social media."

In the meantime, Beshear said parents need to watch even more closely what their children are doing online.

“Parents need to know that their kids aren't as safe on the internet as they were just a couple of weeks ago,” he said.

You can read the Attorney General’s internet safety tool kit for parents here.

Copyright 2017 WDRB Media. All rights reserved.