publish function blocks DOM redraw.