Close file before exiting get_value function.