fix crash in BallExample