fixed another crash with global variable