Fixed endGame function

Now Game Over works correctly