code refactoring
added ping request