small fixes in window loading