Fix black screen in window problem