added game over detection