fix loading window bug