Fixed window.onload event