Court ruling on sex offenders prompts lawmakers to act