bad design with global variable