prepare window