fix bad data check