fix wrong scope assignment