diff --git a/ipaacalib/java/src/ipaaca/Buffer.java b/ipaacalib/java/src/ipaaca/Buffer.java
index d8851d4254a917d7d3f464cfd5c12f26fc7df1da..c56a985dbf58cc0a6d849ed2dab5fdffca3b3411 100644
--- a/ipaacalib/java/src/ipaaca/Buffer.java
+++ b/ipaacalib/java/src/ipaaca/Buffer.java
@@ -110,6 +110,11 @@ public abstract class Buffer
     {
         eventHandlers.add(handler);
     }
+    
+    public void removeHandler(IUEventHandler handler)
+    {
+        eventHandlers.remove(handler);
+    }
 
     public void registerHandler(HandlerFunctor func) {
     	IUEventHandler handler;
diff --git a/ipaacalib/java/src/ipaaca/util/communication/FutureIU.java b/ipaacalib/java/src/ipaaca/util/communication/FutureIU.java
index 1cd48549a65e6f968ec9b94907743ea59cb546e7..7c69017bbd773c164d92bb5e56cd9340106515c5 100644
--- a/ipaacalib/java/src/ipaaca/util/communication/FutureIU.java
+++ b/ipaacalib/java/src/ipaaca/util/communication/FutureIU.java
@@ -8,6 +8,7 @@ import com.google.common.collect.ImmutableSet;
 
 import ipaaca.AbstractIU;
 import ipaaca.HandlerFunctor;
+import ipaaca.IUEventHandler;
 import ipaaca.IUEventType;
 import ipaaca.InputBuffer;
 
@@ -15,18 +16,19 @@ import ipaaca.InputBuffer;
  * Obtain a IU in the future. Usage:<br>
  * FutureIU fu = FutureIU("componentx", "status", "started"); //wait for componentx to send a message that is it fully started<br>
  * [Start componentx, assumes that component x will send a message or other iu with status=started in the payload]<br>
- * AbstractIU iu = fu.take();  //get the actual IU 
+ * AbstractIU iu = fu.take(); //get the actual IU
  * @author hvanwelbergen
  */
 public class FutureIU
 {
     private final InputBuffer inBuffer;
     private final BlockingQueue<AbstractIU> queue = new ArrayBlockingQueue<AbstractIU>(1);
-    
-    public FutureIU(String category, String idKey, String idVal)
+    private final IUEventHandler handler;
+
+    public FutureIU(String category, String idKey, String idVal, InputBuffer inBuffer)
     {
-        inBuffer = new InputBuffer("FutureIU", ImmutableSet.of(category));
-        inBuffer.registerHandler(new HandlerFunctor()
+        this.inBuffer = inBuffer;
+        handler = new IUEventHandler(new HandlerFunctor()
         {
             @Override
             public void handle(AbstractIU iu, IUEventType type, boolean local)
@@ -34,14 +36,32 @@ public class FutureIU
                 String id = iu.getPayload().get(idKey);
                 if (idVal.equals(id))
                 {
-                    queue.offer(iu);                    
+                    queue.offer(iu);
                 }
             }
         }, ImmutableSet.of(category));
+        inBuffer.registerHandler(handler);
+    }
+
+    public FutureIU(String category, String idKey, String idVal)
+    {
+        this(category, idKey, idVal, new InputBuffer("FutureIU", ImmutableSet.of(category)));
+    }
+
+    /**
+     * Closes the FutureIU, use only if get is not used.
+     */
+    public void cleanup()
+    {
+        inBuffer.removeHandler(handler);
+        if (inBuffer.getOwningComponentName().equals("FutureIU"))
+        {
+            inBuffer.close();
+        }
     }
 
     /**
-     * Waits (if necessary) for the IU and take it (can be done only once)     
+     * Waits (if necessary) for the IU and take it (can be done only once)
      */
     public AbstractIU take() throws InterruptedException
     {
@@ -52,13 +72,13 @@ public class FutureIU
         }
         finally
         {
-            inBuffer.close();
+            cleanup();
         }
         return iu;
     }
 
     /**
-     * Wait for at most the given time for the IU and take it (can be done only once), return null on timeout    
+     * Wait for at most the given time for the IU and take it (can be done only once), return null on timeout
      */
     public AbstractIU take(long timeout, TimeUnit unit) throws InterruptedException
     {
@@ -69,16 +89,8 @@ public class FutureIU
         }
         finally
         {
-            inBuffer.close();
+            cleanup();
         }
         return iu;
     }
-    
-    /**
-     * Closes the FutureIU, use only if get is not used.
-     */
-    public void close()
-    {
-        inBuffer.close();
-    }
 }