Added pinging function.