better error messages for bad input files