fix logic on win detection