key_commit: fixed bug in document processing