Is global.set(var,value) required?

Yes, it is. Explanation can be found here: