correction of a bug when the ball gets stuck in the bar