Initialise root variable after defining document