applying the CSS to recreated DOM part before adding it to the given node works better