updated control script for document processing