added window.onload event in js