open output file only after input file verification.