Fix object use outside its scope.