changed ping code