Fixed issue with not destroying window on discharging battery