Fix error on stat when output file dos not exists