onload function called first inside script