fix output file when output preference is undefined