Fix winning condition check