Adding Sim.R global variable fix