Reworked the ping method