fixed a bug with setting wrong document to COMPLETED