added closing of save file