diff --git a/src/clusterpost-execution/executionserver.methods.js b/src/clusterpost-execution/executionserver.methods.js
index <HASH>..<HASH> 100644
--- a/src/clusterpost-execution/executionserver.methods.js
+++ b/src/clusterpost-execution/executionserver.methods.js
@@ -230,7 +230,12 @@ module.exports = function (conf) {
 	handler.createOutputDirs = function(doc){
 		var cwd = handler.getDirectoryCWD(doc);
 		_.each(doc.outputs, (output)=>{
-			var target_dir = path.dirname(path.join(cwd, output.name));
+			if(output.type == "directory"){
+				var target_dir = path.join(cwd, output.name);	
+			}else{
+				var target_dir = path.dirname(path.join(cwd, output.name));
+			}
+			
 			if(!fs.existsSync(target_dir)){
 				fs.mkdirSync(target_dir, {recursive: true});
 			}
BUG: If the output type is directory create it

If the output type is directory, don't get the dirname