add metadata to top of doc