Fixed bug when win is not shown