endGame block with bug