try putting the main call to pizzaElementGenerator() within an event listener for page loaded