Added ping handling