Need some help fixing my game

I made a game for a final project in school. It is a version of brick breaker and seems to work fine until the ball gets stuck toggling on the right wall like it is stuck between two bricks even though there is no bricks and in some cases there has never been a brick. Does anyone know how I could possible fix this?

I need link