document.onload is fired too late