Fixed issues with win logic