Make add_value_genrator a contextmanager.