fix onWin error