improvement handle window layers and visibility