added missing global flag to replace all instances