return 0 if there is no valid data