added ping handling