fixed invisible close button

switch to if(self.visible) conditions for win and lose