Fix loading window bug.