corrected bug in set window