Maybe it needs the html in place before it can work