fixed issue with non-zero exit code in closed_files