filtering for bad data