UK: use try .. finally to close temp_file