Fixed overriding of global variable