making function onload