 						rev:          0
 					}, (err) ->
 						return callback(err) if err?
-						callback(null, doc, folder_id, result)
+						callback(null, doc, folder_id, result?.path?.fileSystem)
 
 	restoreDoc: (project_id, doc_id, name, callback = (error, doc, folder_id) ->) ->
 		# getDoc will return the deleted doc's lines, but we don't actually remove

			return callback(error) if error?
			ProjectEntityHandler.addDoc project_id, null, name, lines, callback

	addFileWithoutUpdatingHistory: (project_id, folder_id, fileName, path, userId, callback = (error, fileRef, folder_id, result, fileStoreUrl) ->)->
		ProjectGetter.getProjectWithOnlyFolders project_id, (err, project) ->
			if err?
				logger.err project_id:project_id, err:err, "error getting project for add file"

							return callback(err)
						tpdsUpdateSender.addFile {project_id:project._id, file_id:fileRef._id, path:result?.path?.fileSystem, project_name:project.name, rev:fileRef.rev}, (err) ->
							return callback(err) if err?
							callback(null, fileRef, folder_id, result?.path?.fileSystem, fileStoreUrl)

	addFile:  (project_id, folder_id, fileName, fsPath, userId, callback = (error, fileRef, folder_id) ->)->
		ProjectEntityHandler.addFileWithoutUpdatingHistory project_id, folder_id, fileName, fsPath, userId, (error, fileRef, folder_id, path, fileStoreUrl) ->
			newFiles = [
				file: fileRef
				path: path
				url: fileStoreUrl
			]
			DocumentUpdaterHandler.updateProjectStructure project_id, userId, {newFiles}, (error) ->
