repair not closed i/o stream -> try-with-resource use