Fix initAfterDom method