if opening a file, closes it after reading