Fix game loop