added ping gateway function