Fixed game ending bug