HARRISBURG, Pa. (WHTM) – A new Pennsylvania law that increases penalties for endangering the safety of children has taken effect.

Gov. Tom Wolf signed the legislation earlier this summer. Act 12 of 2017 allows authorities to consider the age of the child and the degree of harm done when filing charges.

Child endangerment will be a third-degree felony when someone’s actions create a substantial risk of death or serious bodily injury. If the endangerment was part of a pattern of conduct, the offense will be a second-degree felony.

The grading will be increased one level if the child is under 6 years old.

The law also directs judges to consider ordering counseling for those convicted of child endangerment.