need to close file if Exception gets raised