move bind event under window.onload event