Fixed bug

Fixed bug with global variable running set to true.
Caused to crash the program