Added EndGame check