changed window.onload to document.redy