corrected issue for closing TGG files