 				projectLocator.findElement {project:project, element_id:entity_id, type:entityType}, (error, entity, entPath, parentFolder)=>
 					return callback(error) if error?
 					# check if the new name already exists in the current folder
-					ProjectEntityHandler.checkElementName parentFolder, newName, (error) =>
+					ProjectEntityHandler.checkValidElementName parentFolder, newName, (error) =>
 						return callback(error) if error?
 						endPath = path.join(path.dirname(entPath.fileSystem), newName)
 						conditions = {_id:project_id}

							return callback(err)
						callback(err, {path:newPath}, project)

	checkElementName: (folder, name, callback = (err) ->) ->
		# check if the name is already taken by a doc, file or
		# folder. If so, return an error "file already exists".
		err = new Errors.InvalidNameError("file already exists")

				newPath =
					fileSystem: "#{path.fileSystem}/#{element.name}"
					mongo: path.mongo
				ProjectEntityHandler.checkValidElementName folder, element.name, (err) =>
					return callback(err) if err?
					id = element._id+''
					element._id = require('mongoose').Types.ObjectId(id)
