working with input file - missing better error detection