Make PING code more conditional