add the accident processing function