fix if statment for ping