NASHVILLE — Tennessee probably staved off the loss of millions of dollars in crime aid by changing its sex offender laws.

The Tennessee Bureau of Investigation estimated that some $5 million in federal grant money would have been lost if the state didn’t put in its application by the end of July to show it meets requirements of the 2006 Adam Walsh Act.

Part of those requirements included scanning all sex offender records into computers and a requirement that juvenile sex offenders aged 14 to 17 be included in the state’s sex offender registry. Youth advocates opposed putting juveniles on the registry, but the state was able to work out a compromise: Juvenile sex offenders will be added to a special private registry available only to law enforcement agencies.