fixed case of no existing output file