fixing global variable