added win logic