fix some bugs on judging gameover timing