fixed an exitmethod for the gameloop