winner check function added