fix window.onload event listener