Fixed defect when showing window for the first time