changed None to env.var_scope.parent in update_variable