moved onload function