added a bounds check so that balls thown out of the court will not break the game flow