fix window load event