add createElement and provide a callback for links loaded