adding error checking, stop execution if the pregen working datafile does not exist