 		# original check path.resolve("/", element.name) isnt "/#{element.name}" or element.name.match("/")
 		# check if name is allowed
 		if not SafePath.isCleanFilename element.name
-			e = new Error("invalid element name")
+			e = new Errors.InvalidNameError("invalid element name")
 			logger.err project_id:project._id, folder_id:folder_id, element:element, type:type, "failed trying to insert element as name was invalid"
 			return callback(e)
 

	addFolderWithProject: (project, parentFolder_id, folderName, callback = (err, folder, parentFolder_id)->) ->
		# check if folder name is allowed
		if not SafePath.isCleanFilename folderName
			return callback new Error("invalid element name")
		confirmFolder project, parentFolder_id, (parentFolder_id)=>
			folder = new Folder name: folderName
			logger.log project: project._id, parentFolder_id:parentFolder_id, folderName:folderName, "adding new folder"

	addFileWithoutUpdatingHistory: (project_id, folder_id, fileName, path, userId, callback = (error, fileRef, folder_id, path, fileStoreUrl) ->)->
		# check if file name is allowed
		if not SafePath.isCleanFilename fileName
			return callback new Errors.InvalidNameError("invalid element name")
		ProjectGetter.getProject project_id, {rootFolder:true, name:true}, (err, project) ->
			if err?
				logger.err project_id:project_id, err:err, "error getting project for add file"
