global variable NULL fix