updated to use Document table instead of taskbuffer