fix a bug of path when tail index is less than head index
fix a bug of check game over wrong