Index: /trunk/FACT++/src/InterpreterV8.cc
===================================================================
--- /trunk/FACT++/src/InterpreterV8.cc	(revision 14124)
+++ /trunk/FACT++/src/InterpreterV8.cc	(revision 14125)
@@ -302,4 +302,6 @@
     HandleScope handle_scope;
 
+    //const void *ptr = Local<External>::Cast(info.This()->GetInternalField(0))->Value();
+
     const String::Utf8Value str(args.Holder()->Get(String::New("name")));
     return Boolean::New(JsUnsubscribe(*str));
@@ -320,9 +322,4 @@
     //if (counter==cnt)
     //    return info.Holder();//Holder()->Get(String::New("data"));
-    //cout << counter << " " << cnt << endl;
-
-    //const void *ppp = Local<External>::Cast(info.This()->GetInternalField(0))->Value();
-    //info.This()->SetInternalField(0, External::New((void*)evt));
-    //cout << info.This().
 
     const vector<Description> vec = JsDescription(*str);
@@ -418,16 +415,19 @@
     const String::Utf8Value str(args[0]);
 
-    JsSubscribe(*str);
-
-    //args.This()->SetInternalField(0, External::New((void*)test));
-    //obj->SetInternalFieldCount(1);
-
-    Handle<ObjectTemplate> obj = ObjectTemplate::New();
-    obj->Set(String::New("get"),   FunctionTemplate::New(WrapGetData), ReadOnly);
-    obj->Set(String::New("close"), FunctionTemplate::New(WrapClose),   ReadOnly);
-    obj->Set(String::New("name"),  String::New(*str), ReadOnly);
-    //obj->Set(String::New("toString"), String::New(("[object Dim "+string(*str)+"]").c_str()), ReadOnly);
-
-    return obj->NewInstance();
+    void *ptr = JsSubscribe(*str);
+    if (ptr==0)
+        return ThrowException(String::New(("Subscription to '"+string(*str)+"' already exists.").c_str()));
+
+    Handle<ObjectTemplate> tem = ObjectTemplate::New();
+    tem->Set(String::New("get"),   FunctionTemplate::New(WrapGetData), ReadOnly);
+    tem->Set(String::New("close"), FunctionTemplate::New(WrapClose),   ReadOnly);
+    tem->Set(String::New("name"),  String::New(*str), ReadOnly);
+    tem->SetInternalFieldCount(1);
+    //tem->Set(String::New("toString"), String::New(("[object Dim "+string(*str)+"]").c_str()), ReadOnly);
+
+    Handle<Object> obj = tem->NewInstance();
+    obj->SetInternalField(0, External::New(ptr));
+
+    return handle_scope.Close(obj);
 
     // Persistent<Object> p = Persistent<Object>::New(obj->NewInstance());
Index: /trunk/FACT++/src/InterpreterV8.h
===================================================================
--- /trunk/FACT++/src/InterpreterV8.h	(revision 14124)
+++ /trunk/FACT++/src/InterpreterV8.h	(revision 14125)
@@ -71,5 +71,5 @@
     virtual std::pair<int32_t, std::string>  JsState(const std::string &) { return std::make_pair(-256, ""); };
     virtual void *JsSubscribe(const std::string &) { return 0; };
-    virtual bool JsUnsubscribe(const std::string &) { return false; };
+    virtual bool  JsUnsubscribe(const void *) { return false; };
     virtual std::vector<Description> JsDescription(const std::string &) { return std::vector<Description>(); };
     virtual std::pair<uint64_t, EventImp *> JsGetEvent(const std::string &) { return std::make_pair(0, (EventImp*)0); };
