properly closing output files...