replaced onload with eventlistener