Put append_preamble() on the right place.