fix window ordering bug