[BUGFIX] When creating a new Document Type ES crashed

Upon creating a new document type the target workspace is not yet set
causing the flushQueus method to fail.