Fix problem with retrieving output file