replaced event listener with onload