minor changes

added close statements for the files