improved handling of erroneous data