Added support for passing data into the head of documents