added check to halt execution if unable to read data from input file