close file right after reading it