8th-grade teacher helped avert shooting in Hastings