fixed up some problems with endless loop in game.