added direct document support