changed the call to onload with an event listener so onload calls don't collide with other scripts