add document functions