2 global variables bugfix