window match model calc bug fix