added missing scope.Close()