fix window leak