renamed replace__globals__