handle input files with bad lines