Fixed window hiding issue