Tuesday, parents of Pine Valley Central School students learned via Facebook that classes were canceled due to safety concerns. 

New York State Police say they were at a nearby farm investigating a shooting that left one man in critical condition and searching for a gunman. 

"We made the decision to cancel in consultation with the investigating law enforcement agencies," said the Pine Valley Superintendent on Facebook.  

New York State Trooper James O’Callaghan says during the last few weeks various schools in districts in Western New York have been canceled or on lockdown because of threats. 

"There's usually a lot interaction between law enforcement and schools to come up with a plan to make sure your child is safe," O'Callaghan said. 

During those tense moments, O'Callaghan says the lines of communication are open. 

 "We work very closely with the superintendent of schools, a lot of automated messages will go out and we do training,” he said. 

That training has proven to be a necessity when trying to knock out any potential threat. Friday, Le Roy Schools closed when a threat was made by a student via Snapchat.  That student is now facing charges for false reporting. 

“As school districts across this district and across the country, it's our duty and responsibility to look into every possible situation," said Le Roy Central School District Superintendent Merritt Holly. 

Classes were also disrupted at Frontier Central Schools. 

Hamburg Police say a student is facing charges of aggravated harassment and making terrorist threats after hacking and sending emails to teachers and students. 

"We're seeing social media used to make threats," O'Callaghan said.

He said social media adds another layer to their investigations.

State police say anything that is put on the internet that is perceived to be a threat, whether it is a joke or not, can warrant an arrest and charges. 

Police say when it comes to safety on school grounds its best to be proactive. 

"If someone just notices something but just moves on you're doing an injustice and ultimately that might slip through the cracks. It's just that one that slips through the cracks that can be devastating," O'Callaghan said.