refine dadegan reader
close input files after using