handling bad data in files