added missing
close output file