updating functionality to ensure onAdd callback functions can be called before script execution - to ensure cookies can be set.