clean up of game loop