Added a change to assignGlobal, there is other way to do, but test this first