EndOfGame detection added