Loophole in state law allows nursing home sex offenders to go undetected