used document onload boilerplate in js