game loop exception handling